added mass tool and improved import

This commit is contained in:
Syping 2017-12-17 13:03:43 +01:00
parent 98b7c766fe
commit 9b6253b848
40 changed files with 19799 additions and 1189 deletions

View file

@ -810,6 +810,9 @@ QImage SnapmaticPicture::getImage(bool fastLoad)
picStream->close();
delete picStream;
rawPicContent.clear();
rawPicContent.squeeze();
if (returnOk)
{
if (!fastLoadU)
@ -835,6 +838,22 @@ QImage SnapmaticPicture::getImage(bool fastLoad)
return QImage();
}
QByteArray SnapmaticPicture::getPictureStream() // Incomplete because it just work in writeEnabled mode
{
QByteArray jpegRawContent;
if (writeEnabled)
{
QBuffer *picStream = new QBuffer(&rawPicContent);
picStream->open(QIODevice::ReadWrite);
if (picStream->seek(jpegStreamEditorBegin))
{
jpegRawContent = picStream->read(jpegPicStreamLength);
}
delete picStream;
}
return jpegRawContent;
}
int SnapmaticPicture::getContentMaxLength()
{
return jpegRawContentSize;
@ -856,6 +875,11 @@ void SnapmaticPicture::emitUpdate()
emit updated();
}
void SnapmaticPicture::emitCustomSignal(const QString &signal)
{
emit customSignal(signal);
}
// JSON part
bool SnapmaticPicture::isJsonOk()
@ -1351,7 +1375,7 @@ bool SnapmaticPicture::isFormatSwitched()
bool SnapmaticPicture::verifyTitle(const QString &title)
{
// VERIFY TITLE FOR BE A VALID SNAPMATIC TITLE
if (title.length() <= titlStreamCharacterMax)
if (title.length() <= titlStreamCharacterMax && title.length() > 0)
{
for (QChar titleChar : title)
{