diff --git a/cplusplus/extensions/pqc_extensionmethods.cpp b/cplusplus/extensions/pqc_extensionmethods.cpp index e77fa66ae..d5055f7d5 100644 --- a/cplusplus/extensions/pqc_extensionmethods.cpp +++ b/cplusplus/extensions/pqc_extensionmethods.cpp @@ -137,15 +137,15 @@ QString PQCExtensionMethods::path2ImageProvider(QString path, bool thumb) { return ""; if(thumb) - return "image://thumb/" % path; + return "image://thumb/" + path; QFileInfo info(path); const QString suf = info.suffix().toLower(); if(suf == "svg" || suf == "svgz") - return "image://svg/" % path; + return "image://svg/" + path; - return "image://full/" % path; + return "image://full/" + path; } diff --git a/cplusplus/extensions/pqc_extensionshandler.cpp b/cplusplus/extensions/pqc_extensionshandler.cpp index 237d53df2..3b8e3ca82 100644 --- a/cplusplus/extensions/pqc_extensionshandler.cpp +++ b/cplusplus/extensions/pqc_extensionshandler.cpp @@ -113,22 +113,22 @@ void PQCExtensionsHandler::setup() { #ifdef Q_OS_UNIX #ifdef NDEBUG #ifdef PQMAPPIMAGEBUILD - m_systemExtensionDir = QCoreApplication::applicationDirPath() % "/../" % QString(PQMSHAREDLIBDIR) % "/PhotoQt/extensions"; + m_systemExtensionDir = QCoreApplication::applicationDirPath() + "/../" + QString(PQMSHAREDLIBDIR) + "/PhotoQt/extensions"; const QStringList checkDirs = {PQCConfigFiles::get().EXTENSION_DATA_DIR(), m_systemExtensionDir}; #else - m_systemExtensionDir = QString(PQMINSTALLPREFIX) % "/" % QString(PQMSHAREDLIBDIR) % "/PhotoQt/extensions"; + m_systemExtensionDir = QString(PQMINSTALLPREFIX) + "/" + QString(PQMSHAREDLIBDIR) + "/PhotoQt/extensions"; const QStringList checkDirs = {PQCConfigFiles::get().EXTENSION_DATA_DIR(), m_systemExtensionDir}; #endif #else - m_systemExtensionDir = QString(PQMBUILDDIR) % ("/extensions"); + m_systemExtensionDir = QString(PQMBUILDDIR) + ("/extensions"); const QStringList checkDirs = {m_systemExtensionDir, PQCConfigFiles::get().EXTENSION_DATA_DIR(), - QCoreApplication::applicationDirPath() % "/" % QString(PQMSHAREDLIBDIR) % "/PhotoQt/extensions"}; + QCoreApplication::applicationDirPath() + "/" + QString(PQMSHAREDLIBDIR) + "/PhotoQt/extensions"}; #endif #else - m_systemExtensionDir = QCoreApplication::applicationDirPath() % "/extensions"; + m_systemExtensionDir = QCoreApplication::applicationDirPath() + "/extensions"; const QStringList checkDirs = {PQCConfigFiles::get().EXTENSION_DATA_DIR(), m_systemExtensionDir}; #endif @@ -150,10 +150,10 @@ void PQCExtensionsHandler::setup() { const QString hashId = (isSystemExtension ? QCryptographicHash::hash(nameId.toUtf8(), QCryptographicHash::Md5).toHex() : QCryptographicHash::hash(extensionDir.toUtf8(), QCryptographicHash::Md5).toHex()); - const QString identifyName = nameId % " (" % extensionDir % ")"; + const QString identifyName = nameId + " (" + extensionDir + ")"; // if there is a YAML file, then we load that one - const QString yamlfile = extensionDir % "/manifest.yml"; + const QString yamlfile = extensionDir + "/manifest.yml"; if(!QFile::exists(yamlfile)) { qWarning() << "Required YAML file not found for extension" << identifyName; @@ -217,7 +217,7 @@ void PQCExtensionsHandler::setup() { if(extEnabled) { m_extensions.append(hashId); - const QString qmfile = extinfo->location % "/lang/" % nameId % "_" % PQCScriptsLocalization::get().getActiveTranslationCode() % ".qm"; + const QString qmfile = extinfo->location + "/lang/" + nameId + "_" + PQCScriptsLocalization::get().getActiveTranslationCode() + ".qm"; if(trans->load(qmfile)) { qDebug() << identifyName << "- installing translation file:" << qmfile; qApp->installTranslator(trans.get()); @@ -269,7 +269,7 @@ bool PQCExtensionsHandler::loadExtension(std::shared_ptr &exti YAML::Node config; - const QString identifyName = nameId % " (" % extensionDir % ")"; + const QString identifyName = nameId + " (" + extensionDir + ")"; // LOAD yaml file try { @@ -368,14 +368,14 @@ bool PQCExtensionsHandler::loadExtension(std::shared_ptr &exti // check localizations for name for(const QString &lang : langLst) { try { - const std::string langStr = QString("name[" % lang % "]").toStdString(); + const std::string langStr = QString("name[" + lang + "]").toStdString(); if(config["about"][langStr].IsDefined()) { const QString val = QString::fromStdString(config["about"][langStr].as()); extinfo->nameLocalized[lang] = val; } else { const int langIdx = lang.indexOf("_"); if(langIdx > -1) { - const std::string lang_Str = QString("name[" % lang.mid(0,langIdx) % "]").toStdString(); + const std::string lang_Str = QString("name[" + lang.mid(0,langIdx) + "]").toStdString(); if(config["about"][lang_Str].IsDefined()) { const QString val = QString::fromStdString(config["about"][lang_Str].as()); extinfo->nameLocalized[lang] = val; @@ -388,14 +388,14 @@ bool PQCExtensionsHandler::loadExtension(std::shared_ptr &exti for(const QString &lang : langLst) { if(haveProperLongName) { try { - const std::string langStr = QString("longName[" % lang % "]").toStdString(); + const std::string langStr = QString("longName[" + lang + "]").toStdString(); if(config["about"][langStr].IsDefined()) { const QString val = QString::fromStdString(config["about"][langStr].as()); extinfo->longNameLocalized[lang] = val; } else { const int langIdx = lang.indexOf("_"); if(langIdx > -1) { - const std::string lang_Str = QString("longName[" % lang.mid(0,langIdx) % "]").toStdString(); + const std::string lang_Str = QString("longName[" + lang.mid(0,langIdx) + "]").toStdString(); if(config["about"][lang_Str].IsDefined()){ const QString val = QString::fromStdString(config["about"][lang_Str].as()); extinfo->longNameLocalized[lang] = val; @@ -409,14 +409,14 @@ bool PQCExtensionsHandler::loadExtension(std::shared_ptr &exti // check localizations for description for(const QString &lang : langLst) { try { - const std::string langStr = QString("description[" % lang % "]").toStdString(); + const std::string langStr = QString("description[" + lang + "]").toStdString(); if(config["about"][langStr].IsDefined()) { const QString val = QString::fromStdString(config["about"][langStr].as()); extinfo->descriptionLocalized[lang] = val; } else { const int langIdx = lang.indexOf("_"); if(langIdx > -1) { - const std::string lang_Str = QString("description[" % lang.mid(0,langIdx) % "]").toStdString(); + const std::string lang_Str = QString("description[" + lang.mid(0,langIdx) + "]").toStdString(); if(config["about"][lang_Str].IsDefined()){ const QString val = QString::fromStdString(config["about"][lang_Str].as()); extinfo->descriptionLocalized[lang] = val; @@ -579,7 +579,7 @@ bool PQCExtensionsHandler::loadExtension(std::shared_ptr &exti } else { - const QString libName = extensionDir % "/" % filList.at(0); + const QString libName = extensionDir + "/" + filList.at(0); // linker file does not exist if(!QFile::exists(libName)) { @@ -688,7 +688,7 @@ QString PQCExtensionsHandler::getExtensionLocation(QString id) { } QString PQCExtensionsHandler::getExtensionConfigLocation(QString id) { - const QString path = PQCConfigFiles::get().EXTENSION_CONFIG_DIR() % "/" % id; + const QString path = PQCConfigFiles::get().EXTENSION_CONFIG_DIR() + "/" + id; QDir dir(path); if(!dir.exists(path)) dir.mkpath(path); @@ -696,7 +696,7 @@ QString PQCExtensionsHandler::getExtensionConfigLocation(QString id) { } QString PQCExtensionsHandler::getExtensionDataLocation(QString id) { - const QString path = PQCConfigFiles::get().EXTENSION_DATA_DIR() % "/" % id; + const QString path = PQCConfigFiles::get().EXTENSION_DATA_DIR() + "/" + id; QDir dir(path); if(!dir.exists(path)) dir.mkpath(path); @@ -704,7 +704,7 @@ QString PQCExtensionsHandler::getExtensionDataLocation(QString id) { } QString PQCExtensionsHandler::getExtensionCacheLocation(QString id) { - const QString path = PQCConfigFiles::get().EXTENSION_CACHE_DIR() % "/" % id; + const QString path = PQCConfigFiles::get().EXTENSION_CACHE_DIR() + "/" + id; QDir dir(path); if(!dir.exists(path)) dir.mkpath(path); @@ -948,7 +948,7 @@ bool PQCExtensionsHandler::getExtensionHasCPPActions(QString id) { bool PQCExtensionsHandler::getHasSettings(const QString &id) { if(m_allextensions.contains(id)) - return QFile::exists(m_allextensions[id]->location % "/qml/" % m_allextensions[id]->nameId % "Settings.qml"); + return QFile::exists(m_allextensions[id]->location + "/qml/" + m_allextensions[id]->nameId + "Settings.qml"); qWarning() << "Unknown extension id:" << id; return false; } @@ -1066,7 +1066,7 @@ void PQCExtensionsHandler::setEnabledExtensions(const QStringList &ids) { m_extensions = ids; m_numExtensionsEnabled = m_extensions.length(); for(const QString &id : ids) { - const QString qmfile = m_allextensions.value(id)->location % "/lang/" % id % "_" % PQCScriptsLocalization::get().getActiveTranslationCode() % ".qm"; + const QString qmfile = m_allextensions.value(id)->location + "/lang/" + id + "_" + PQCScriptsLocalization::get().getActiveTranslationCode() + ".qm"; if(!QFile::exists(qmfile)) qDebug() << id << "- no translation file found:" << qmfile; else { @@ -1129,7 +1129,7 @@ int PQCExtensionsHandler::installExtension(QString filepath) { msg.setIcon(QMessageBox::Critical); msg.setWindowFlag(Qt::WindowStaysOnTopHint); msg.setWindowTitle("Invalid extension"); - msg.setText("The extension does not appear to be valid and cannot be installed.\n\nError message:\n" % meta["error"].toString()); + msg.setText("The extension does not appear to be valid and cannot be installed.\n\nError message:\n" + meta["error"].toString()); msg.setStandardButtons(QMessageBox::Ok); msg.exec(); @@ -1141,12 +1141,12 @@ int PQCExtensionsHandler::installExtension(QString filepath) { msg.setIcon(QMessageBox::Question); msg.setWindowTitle("Install extension?"); msg.setWindowFlag(Qt::WindowStaysOnTopHint); - msg.setText("Do you want to install this extension?

Name: " % meta["name"].toString() % - " (version: " % QString::number(meta["version"].toInt()) % - ")
Description: " % meta["description"].toString() % - "
Author: " % meta["author"].toString() % - "
Contact: " % meta["contact"].toString() % - "
Website: " % meta["website"].toString() % ""); + msg.setText("Do you want to install this extension?

Name: " + meta["name"].toString() + + " (version: " + QString::number(meta["version"].toInt()) + + ")
Description: " + meta["description"].toString() + + "
Author: " + meta["author"].toString() + + "
Contact: " + meta["contact"].toString() + + "
Website: " + meta["website"].toString() + ""); msg.setTextFormat(Qt::RichText); msg.setStandardButtons(QMessageBox::Yes|QMessageBox::No); msg.setDefaultButton(QMessageBox::No); @@ -1192,7 +1192,7 @@ int PQCExtensionsHandler::installExtension(QString filepath) { if(!wpath) continue; QString filenameinside = QString::fromWCharArray(wpath); - QString fullpath = PQCConfigFiles::get().DATA_DIR() % "/extensions/" % filenameinside; + QString fullpath = PQCConfigFiles::get().DATA_DIR() + "/extensions/" + filenameinside; if(fullpath.endsWith("/")) { if(nameId.isEmpty()) @@ -1272,9 +1272,9 @@ int PQCExtensionsHandler::installExtension(QString filepath) { if(numFilesSuccess > 0) { - const QString extensionDir = QFileInfo(PQCConfigFiles::get().EXTENSION_DATA_DIR() % "/" % nameId % "/tmp.txt").absolutePath(); + const QString extensionDir = QFileInfo(PQCConfigFiles::get().EXTENSION_DATA_DIR() + "/" + nameId + "/tmp.txt").absolutePath(); const QString hashId = QCryptographicHash::hash(extensionDir.toUtf8(), QCryptographicHash::Md5).toHex(); - const QString identifyName = nameId % " (" % extensionDir % ")"; + const QString identifyName = nameId + " (" + extensionDir + ")"; if(m_allextensions.contains(hashId)) return 2; @@ -1284,7 +1284,7 @@ int PQCExtensionsHandler::installExtension(QString filepath) { extinfo->internalId = hashId; extinfo->nameId = nameId; - QFile fy(extinfo->location % "/manifest.yml"); + QFile fy(extinfo->location + "/manifest.yml"); if(!fy.open(QIODevice::ReadOnly)) { qWarning() << "Unable to read manifest.yml for reading"; return -1; @@ -1339,7 +1339,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi int r = archive_read_open_filename(a, tmpPath.constData(), 10240); #endif if(r != ARCHIVE_OK) { - QString msg = "ERROR: archive_read_open_filename() returned code of " % QString::number(r); + QString msg = "ERROR: archive_read_open_filename() returned code of " + QString::number(r); qWarning() << msg; ret["error"] = msg; return ret; @@ -1365,7 +1365,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi int64_t size = archive_entry_size(entry); if(size <= 0) { - QString msg = "Invalid image size of file in archive: " % QString::number(size); + QString msg = "Invalid image size of file in archive: " + QString::number(size); qWarning() << msg; ret["error"] = msg; continue; @@ -1380,7 +1380,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi while (total < size) { la_ssize_t chunk = archive_read_data(a, ptr + total, size - total); if(chunk < 0) { - QString msg = "Invalid chunk read: " % QString::fromStdString(archive_error_string(a)); + QString msg = "Invalid chunk read: " + QString::fromStdString(archive_error_string(a)); qWarning() << msg; ret["error"] = msg; break; @@ -1414,7 +1414,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { config = YAML::Load(definitionyml.toStdString()); } catch(YAML::Exception &e) { - QString msg = "Failed to load YAML file: " % QString(e.what()); + QString msg = "Failed to load YAML file: " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1425,7 +1425,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["about"] = config["about"]["version"].as(); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'version': " % QString(e.what()); + QString msg = "Failed to read value for 'version': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1437,7 +1437,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["name"] = QString::fromStdString(config["about"]["name"].as()); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'name': " % QString(e.what()); + QString msg = "Failed to read value for 'name': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1449,7 +1449,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["description"] = QString::fromStdString(config["about"]["description"].as()); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'description': " % QString(e.what()); + QString msg = "Failed to read value for 'description': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1461,7 +1461,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["author"] = QString::fromStdString(config["about"]["author"].as()); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'author': " % QString(e.what()); + QString msg = "Failed to read value for 'author': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1473,7 +1473,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["contact"] = QString::fromStdString(config["about"]["contact"].as()); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'contact': " % QString(e.what()); + QString msg = "Failed to read value for 'contact': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1485,7 +1485,7 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi try { ret["website"] = QString::fromStdString(config["about"]["website"].as()); } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'website': " % QString(e.what()); + QString msg = "Failed to read value for 'website': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1498,15 +1498,15 @@ QHash PQCExtensionsHandler::getExtensionZipMetadata(QString fi ret["targetAPI"] = config["about"]["targetAPI"].as(); if(ret["targetAPI"].toInt() > CURRENTAPIVERSION) { - QString msg = "Required API version - " % QString::number(ret["targetAPI"].toInt()) % - " - newer than what's supported: " % QString::number(CURRENTAPIVERSION); + QString msg = "Required API version - " + QString::number(ret["targetAPI"].toInt()) + + " - newer than what's supported: " + QString::number(CURRENTAPIVERSION); qWarning() << msg; ret["error"] = msg; err = true; } } catch(YAML::Exception &e) { - QString msg = "Failed to read value for 'targetAPI': " % QString(e.what()); + QString msg = "Failed to read value for 'targetAPI': " + QString(e.what()); qWarning() << msg; ret["error"] = msg; err = true; @@ -1540,19 +1540,19 @@ bool PQCExtensionsHandler::verifyExtension(QString extensionDir, QString nameId) #if defined(PQMEXTENSIONS) && defined(PQMEXTENSIONS_NONSYS_OPENSSL) - const QString identifyName = nameId % " (" % extensionDir % ")"; + const QString identifyName = nameId + " (" + extensionDir + ")"; /*************************************/ // first verify signature of manifest - QFile fmanifest(extensionDir % "/verification.txt"); + QFile fmanifest(extensionDir + "/verification.txt"); if(!fmanifest.open(QIODevice::ReadOnly)) { qWarning() << identifyName << "- unable to read verification.txt:" << QString("%1/verification.txt").arg(extensionDir); return false; } QByteArray manifest = fmanifest.readAll(); - QFile fmanifestsig(extensionDir % "/verification.txt.sig"); + QFile fmanifestsig(extensionDir + "/verification.txt.sig"); if(!fmanifestsig.open(QIODevice::ReadOnly)) { qWarning() << identifyName << "- unable to read verification.txt.sig"; return false; @@ -1672,7 +1672,7 @@ bool PQCExtensionsHandler::verifyExtension(QString extensionDir, QString nameId) return false; } - QFile file(extensionDir % "/" % f); + QFile file(extensionDir + "/" + f); if(!file.open(QIODevice::ReadOnly)) { qWarning() << identifyName << "- unable to read found file:" << f; return false; @@ -1710,11 +1710,11 @@ QStringList PQCExtensionsHandler::listFilesIn(QString dir) { const QStringList lstD = d.entryList(QDir::Dirs|QDir::NoDotAndDotDot); for(const QString &e : lstD) - ret << listFilesIn(dir % "/" % e); + ret << listFilesIn(dir + "/" + e); const QStringList lstF = d.entryList(QDir::Files); for(const QString &e : lstF) - ret << (dir % "/" % e); + ret << (dir + "/" + e); return ret; } @@ -1725,7 +1725,7 @@ void PQCExtensionsHandler::updateTranslationLanguage() { qApp->removeTranslator(extTrans.value(id).get()); for(const QString &id : std::as_const(m_extensions)) { - const QString qmfile = m_allextensions.value(id)->location % "/lang/" % id % "_" % PQCScriptsLocalization::get().getActiveTranslationCode() % ".qm"; + const QString qmfile = m_allextensions.value(id)->location + "/lang/" + id + "_" + PQCScriptsLocalization::get().getActiveTranslationCode() + ".qm"; if(!QFile::exists(qmfile)) qDebug() << id << "- no translation file found:" << qmfile; else { diff --git a/cplusplus/header/pqc_configfiles.h b/cplusplus/header/pqc_configfiles.h index bad9cf6b0..27f77f424 100644 --- a/cplusplus/header/pqc_configfiles.h +++ b/cplusplus/header/pqc_configfiles.h @@ -125,10 +125,10 @@ public: void setThumbnailCacheBaseDir(QString basedir) { #ifdef PQMPORTABLETWEAKS - basedir = qgetenv("PHOTOQT_PORTABLE_DATA_LOCATION") % "/thumbnails/"; + basedir = qgetenv("PHOTOQT_PORTABLE_DATA_LOCATION") + "/thumbnails/"; #else if(basedir.isEmpty()) - basedir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) % "/thumbnails/"; + basedir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/thumbnails/"; #endif qWarning() << "Setting thumbnail cache base dir to:" << basedir; @@ -137,10 +137,10 @@ public: QDir dir(basedir); dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR()); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/normal/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/x-large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/xx-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/normal/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/x-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/xx-large/"); } @@ -150,17 +150,17 @@ private: #ifdef PQMPORTABLETWEAKS const QString portablefolder = qgetenv("PHOTOQT_PORTABLE_DATA_LOCATION"); - m_CONFIG_DIR = portablefolder % "/config/"; - m_DATA_DIR = portablefolder % "/data/"; - m_CACHE_DIR = portablefolder % "/cache/"; + m_CONFIG_DIR = portablefolder + "/config/"; + m_DATA_DIR = portablefolder + "/data/"; + m_CACHE_DIR = portablefolder + "/cache/"; #else m_CONFIG_DIR = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); m_DATA_DIR = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); m_CACHE_DIR = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); #endif - m_EXTENSION_CONFIG_DIR = m_CONFIG_DIR % "/extensions/"; - m_EXTENSION_DATA_DIR = m_DATA_DIR % "/extensions/"; - m_EXTENSION_CACHE_DIR = m_CACHE_DIR % "/extensions/"; + m_EXTENSION_CONFIG_DIR = m_CONFIG_DIR + "/extensions/"; + m_EXTENSION_DATA_DIR = m_DATA_DIR + "/extensions/"; + m_EXTENSION_CACHE_DIR = m_CACHE_DIR + "/extensions/"; QDir dir; dir.mkpath(m_CONFIG_DIR); @@ -168,42 +168,42 @@ private: dir.mkpath(m_CACHE_DIR); #ifdef PQMPORTABLETWEAKS - m_USER_TRASH_FILES = portablefolder % "/Trash/files"; + m_USER_TRASH_FILES = portablefolder + "/Trash/files"; #else - m_USER_TRASH_FILES = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) % "/Trash/files"; + m_USER_TRASH_FILES = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/Trash/files"; #endif #ifdef Q_OS_WIN #ifdef PQMPORTABLETWEAKS - m_USER_PLACES_XBEL = m_CACHE_DIR % "/user-places-" % QSysInfo::machineHostName() % ".xbel"; + m_USER_PLACES_XBEL = m_CACHE_DIR + "/user-places-" + QSysInfo::machineHostName() + ".xbel"; #else - m_USER_PLACES_XBEL = m_CACHE_DIR % "/user-places.xbel"; + m_USER_PLACES_XBEL = m_CACHE_DIR + "/user-places.xbel"; #endif #else - m_USER_PLACES_XBEL = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) % "/user-places.xbel"; + m_USER_PLACES_XBEL = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel"; dir.mkpath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)); #endif #ifdef PQMPORTABLETWEAKS - m_THUMBNAIL_CACHE_DIR = portablefolder % "/thumbnails"; + m_THUMBNAIL_CACHE_DIR = portablefolder + "/thumbnails"; #else - m_THUMBNAIL_CACHE_DIR = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) % "/thumbnails"; + m_THUMBNAIL_CACHE_DIR = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/thumbnails"; dir.mkpath(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)); #endif - m_CONTEXTMENU_DB = m_CONFIG_DIR % "/contextmenu.db"; - m_DEFAULTSETTINGS_DB = m_CACHE_DIR % "/defaultsettings.db"; - m_USERSETTINGS_DB = m_CONFIG_DIR % "/usersettings.db"; - m_QUICKUSERSETTINGS_FILE = m_CACHE_DIR % "/quickusersettings"; - m_OLDSETTINGS_DB = m_CONFIG_DIR % "/settings.db"; - m_SHORTCUTS_DB = m_CONFIG_DIR % "/shortcuts.db"; - m_LOCATION_DB = m_CONFIG_DIR % "/location.db"; - - m_WINDOW_GEOMETRY_FILE = m_CONFIG_DIR % "/geometry"; - m_FILEDIALOG_LAST_LOCATION = m_CACHE_DIR % "/filedialoglastlocation"; - m_LASTOPENEDIMAGE_FILE = m_CONFIG_DIR % "/lastimageloaded"; - m_ICC_COLOR_PROFILE_DIR = m_CACHE_DIR % "/icc"; - m_IMAGEPLUGINS_SETTINGS_DIR = m_CONFIG_DIR % "/imageplugins"; + m_CONTEXTMENU_DB = m_CONFIG_DIR + "/contextmenu.db"; + m_DEFAULTSETTINGS_DB = m_CACHE_DIR + "/defaultsettings.db"; + m_USERSETTINGS_DB = m_CONFIG_DIR + "/usersettings.db"; + m_QUICKUSERSETTINGS_FILE = m_CACHE_DIR + "/quickusersettings"; + m_OLDSETTINGS_DB = m_CONFIG_DIR + "/settings.db"; + m_SHORTCUTS_DB = m_CONFIG_DIR + "/shortcuts.db"; + m_LOCATION_DB = m_CONFIG_DIR + "/location.db"; + + m_WINDOW_GEOMETRY_FILE = m_CONFIG_DIR + "/geometry"; + m_FILEDIALOG_LAST_LOCATION = m_CACHE_DIR + "/filedialoglastlocation"; + m_LASTOPENEDIMAGE_FILE = m_CONFIG_DIR + "/lastimageloaded"; + m_ICC_COLOR_PROFILE_DIR = m_CACHE_DIR + "/icc"; + m_IMAGEPLUGINS_SETTINGS_DIR = m_CONFIG_DIR + "/imageplugins"; } diff --git a/cplusplus/images/plugins/pqc_imageplugin.cpp b/cplusplus/images/plugins/pqc_imageplugin.cpp index d8764dcd0..e08283238 100644 --- a/cplusplus/images/plugins/pqc_imageplugin.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin.cpp @@ -31,7 +31,7 @@ PQCImagePlugin::PQCImagePlugin(QObject *parent) : QObject(parent) { connect(m_delayWriteToFile, &QTimer::timeout, this, [this]() { - const QString filename = PQCConfigFiles::get().CONFIG_DIR() % "/imageplugins/" % m_settingsPrefix; + const QString filename = PQCConfigFiles::get().CONFIG_DIR() + "/imageplugins/" + m_settingsPrefix; QFile outFile(filename); if(!outFile.open(QIODevice::WriteOnly)) { qDebug() << "Failed to open settings file at:" << filename; @@ -135,7 +135,7 @@ void PQCImagePlugin::loadSetttingsFromFiles() { /********************************/ // first we read the toggled suffixes from the settings file - const QString suffixFilename = PQCConfigFiles::get().CONFIG_DIR() % "/imageplugins/" % m_settingsPrefix; + const QString suffixFilename = PQCConfigFiles::get().CONFIG_DIR() + "/imageplugins/" + m_settingsPrefix; QFile suffixFile(suffixFilename); if(!suffixFile.open(QIODevice::ReadOnly|QIODevice::Text)) { diff --git a/cplusplus/images/plugins/pqc_imageplugin_devil.cpp b/cplusplus/images/plugins/pqc_imageplugin_devil.cpp index 3efbe9421..5036643eb 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_devil.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_devil.cpp @@ -154,7 +154,7 @@ const QImage PQCImagePluginDevIL::loadImage(QString path, QSize requestedSize, Q errormsg = checkForError(); if(!errormsg.isEmpty()) { - error += errormsg % "\n"; + error += errormsg + "\n"; qWarning() << errormsg; return QImage(); } @@ -167,7 +167,7 @@ const QImage PQCImagePluginDevIL::loadImage(QString path, QSize requestedSize, Q #endif ilDeleteImages(1, &imageID); const QString err = "Failed to load image with DevIL"; - error += err % "\n"; + error += err + "\n"; qWarning() << err; return QImage(); } @@ -177,13 +177,13 @@ const QImage PQCImagePluginDevIL::loadImage(QString path, QSize requestedSize, Q ilDeleteImages(1, &imageID); const QString err = "Failed to convert image with DevIL"; qWarning() << err; - error += err % "\n"; + error += err + "\n"; return QImage(); } errormsg = checkForError(); if(!errormsg.isEmpty()) { - error += errormsg % "\n"; + error += errormsg + "\n"; qWarning() << errormsg; return QImage(); } @@ -195,7 +195,7 @@ const QImage PQCImagePluginDevIL::loadImage(QString path, QSize requestedSize, Q errormsg = checkForError(); if(!errormsg.isEmpty()) { - error += errormsg % "\n"; + error += errormsg + "\n"; qWarning() << errormsg; return QImage(); } @@ -207,7 +207,7 @@ const QImage PQCImagePluginDevIL::loadImage(QString path, QSize requestedSize, Q if(img.isNull()) { const QString msg = "Failed to create QImage with DevIL (unknown error)!"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_libarchive.cpp b/cplusplus/images/plugins/pqc_imageplugin_libarchive.cpp index 14ab670b3..a5615a9a6 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_libarchive.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_libarchive.cpp @@ -232,7 +232,7 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi QStringList cont = PQCScriptsImages::get().listArchiveContentWithoutThread(archivefile); if(cont.length() == 0) { const QString msg = "Unable to list contents of archive file..."; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -241,7 +241,7 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi if(!QFileInfo::exists(archivefile)) { const QString msg = "File doesn't seem to exist..."; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -313,8 +313,8 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi if(archive_read_open_filename(a, tmpPath.constData(), 10240) != ARCHIVE_OK) { #endif // If something went wrong, output error message and stop here - const QString msg = "archive_read_open_filename() failed: " % QString(archive_error_string(a)); - error += msg % "\n"; + const QString msg = "archive_read_open_filename() failed: " + QString(archive_error_string(a)); + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -341,7 +341,7 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi if(size <= 0) { const QString msg = QString("Invalid image size of file in archive: %1").arg(size); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -357,7 +357,7 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi la_ssize_t chunk = archive_read_data(a, ptr + total, size - total); if(chunk < 0) { const QString msg = QString("Invalid chunk read: %1").arg(archive_error_string(a)); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -371,7 +371,7 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi if(total != size) { const QString msg = QString("Failed to read image data, read size (%1) doesn't match expected size (%2)...").arg(total).arg(size); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -385,14 +385,14 @@ const QImage PQCImagePluginLibarchive::loadImage(QString path, QSize requestedSi // write buffer to file if(!tempFile.open()) { const QString msg = "Unable to load archive file to temporary file."; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } if(tempFile.write(data) != data.size()) { const QString msg = "Failed to write image to temporary file."; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_libraw.cpp b/cplusplus/images/plugins/pqc_imageplugin_libraw.cpp index 6b157729a..02bb621f9 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_libraw.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_libraw.cpp @@ -151,7 +151,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = QString("Failed to run open_file: %1").arg(libraw_strerror(ret)); qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -196,7 +196,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, if(ret != LIBRAW_SUCCESS) { raw.recycle(); const QString msg = QString("Failed to run %1: %2").arg((useThumb ? "unpack_thumb" : "unpack"), libraw_strerror(ret)); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -208,7 +208,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = QString("Failed to run dcraw_process: %1").arg(libraw_strerror(ret)); qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -221,7 +221,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = QString("Failed to create memory image: %1").arg(libraw_strerror(ret)); qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -238,7 +238,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = "Failed to load JPEG data!"; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -259,7 +259,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = "Failed to allocate QImage."; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -278,7 +278,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = "Failed to allocate QImage."; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -302,7 +302,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = "Failed to allocate QImage."; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -319,7 +319,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, raw.recycle(); const QString msg = "Failed to allocate QImage."; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -338,7 +338,7 @@ const QImage PQCImagePluginLibraw::loadImage(QString path, QSize requestedSize, const QString msg = QString("Unsupported RAW output format (colors=%1 bits=%2)").arg(colors).arg(bits); qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_libsai.cpp b/cplusplus/images/plugins/pqc_imageplugin_libsai.cpp index 218608853..6452eb4d2 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_libsai.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_libsai.cpp @@ -73,7 +73,7 @@ const QImage PQCImagePluginLibsai::loadImage(QString path, QSize requestedSize, if(!saidoc.IsOpen()) { const QString msg = "Error opening SAI file for reading."; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_libvips.cpp b/cplusplus/images/plugins/pqc_imageplugin_libvips.cpp index 8f5461f8f..9381cf7f1 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_libvips.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_libvips.cpp @@ -113,7 +113,7 @@ const QImage PQCImagePluginLibVips::loadImage(QString path, QSize requestedSize, VipsImage *vimg = vips_image_new_from_file(path.toStdString().c_str(), "access", VIPS_ACCESS_SEQUENTIAL, NULL); if(!vimg) { const QString msg = "vips_image_new_from_file: failed to load image from file"; - error += msg % "\n"; + error += msg + "\n"; qDebug() << msg; return QImage(); } @@ -126,7 +126,7 @@ const QImage PQCImagePluginLibVips::loadImage(QString path, QSize requestedSize, VipsImage *tmp; if(vips_addalpha(vimg, &tmp, NULL)) { const QString msg = "vips_image_hasalpha failed"; - error += msg % "\n"; + error += msg + "\n"; qDebug() << msg; return QImage(); } @@ -139,7 +139,7 @@ const QImage PQCImagePluginLibVips::loadImage(QString path, QSize requestedSize, if(!memImg) { g_object_unref(vimg); const QString msg = "vips_image_copy_memory failed"; - error += msg % "\n"; + error += msg + "\n"; qDebug() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_magick.cpp b/cplusplus/images/plugins/pqc_imageplugin_magick.cpp index 83c8661fd..6c38e237d 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_magick.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_magick.cpp @@ -434,7 +434,7 @@ const QImage PQCImagePluginMagick::loadImage(QString path, QSize requestedSize, // no attempt was successful -> stop here if(howOftenFailed == mgs.length()) { const QString msg = "Failed to read image"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -471,7 +471,7 @@ const QImage PQCImagePluginMagick::loadImage(QString path, QSize requestedSize, ++howOftenFailed; qWarning() << e.what(); - error += QString(e.what()) % "\n"; + error += QString(e.what()) + "\n"; } diff --git a/cplusplus/images/plugins/pqc_imageplugin_pdf.cpp b/cplusplus/images/plugins/pqc_imageplugin_pdf.cpp index 4c55fbdde..034c49112 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_pdf.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_pdf.cpp @@ -116,7 +116,7 @@ const QImage PQCImagePluginPDF::loadImage(QString path, QSize requestedSize, QSi std::unique_ptr document = Poppler::Document::load(path); if(!document || document->isLocked()) { const QString msg = "Invalid PDF document, unable to load!";; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -158,7 +158,7 @@ const QImage PQCImagePluginPDF::loadImage(QString path, QSize requestedSize, QSi QPdfDocument::Error ret = doc.load(path); if(ret != QPdfDocument::Error::None) { const QString msg = QString("Unable to load pdf using QtPDF: %1").arg(static_cast(ret)); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -166,7 +166,7 @@ const QImage PQCImagePluginPDF::loadImage(QString path, QSize requestedSize, QSi QPdfDocument::Error err = doc.error(); if(err != QPdfDocument::Error::None) { const QString msg = "Error occurred loading PDF"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -180,7 +180,7 @@ const QImage PQCImagePluginPDF::loadImage(QString path, QSize requestedSize, QSi if(p.isNull()) { const QString msg = QString("Unable to read page %1").arg(page); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_qt.cpp b/cplusplus/images/plugins/pqc_imageplugin_qt.cpp index 7606a202c..6de5cbab5 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_qt.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_qt.cpp @@ -134,7 +134,7 @@ PQCImagePluginQt::PQCImagePluginQt() { const QString tmpPath = QDir::tempPath(); for(const int &format : getEnabledFormats()) { const QStringList allsuf = getSuffixesForFormat(format); - writer.setFileName(tmpPath % "/temp." % *allsuf.begin()); + writer.setFileName(tmpPath + "/temp." + *allsuf.begin()); if(writer.canWrite()) { writableFormats.insert(format); } @@ -228,7 +228,7 @@ const QImage PQCImagePluginQt::loadImage(QString path, QSize requestedSize, QSiz // Invalid vector graphic if(!svg.isValid()) { const QString msg = "Error: invalid svg file"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -296,7 +296,7 @@ const QImage PQCImagePluginQt::loadImage(QString path, QSize requestedSize, QSiz if(img.isNull()) { const QString msg = "image reader and QImage unable to read image"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } else { @@ -336,7 +336,7 @@ const QImage PQCImagePluginQt::loadImage(QString path, QSize requestedSize, QSiz // If an error occurred if(img.isNull()) { const QString msg = reader.errorString(); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_resvg.cpp b/cplusplus/images/plugins/pqc_imageplugin_resvg.cpp index ea2856df8..43db5a579 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_resvg.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_resvg.cpp @@ -93,7 +93,7 @@ const QImage PQCImagePluginResvg::loadImage(QString path, QSize requestedSize, Q if(!renderer.isValid()) { const QString msg = "Invalid SVG encountered"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -122,7 +122,7 @@ const QImage PQCImagePluginResvg::loadImage(QString path, QSize requestedSize, Q if(resvg_parse_tree_from_file(path.toUtf8().constData(), opt, &tree) != RESVG_OK) { resvg_options_destroy(opt); const QString msg = "Invalid SVG encountered"; - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } diff --git a/cplusplus/images/plugins/pqc_imageplugin_video.cpp b/cplusplus/images/plugins/pqc_imageplugin_video.cpp index de16b223f..c628f0160 100644 --- a/cplusplus/images/plugins/pqc_imageplugin_video.cpp +++ b/cplusplus/images/plugins/pqc_imageplugin_video.cpp @@ -200,7 +200,7 @@ const QImage PQCImagePluginVideo::loadImage(QString path, QSize requestedSize, Q if(!tempFile.open()) { const QString err = "Unable to open temporary file from thumbnail generation."; qWarning() << err; - error += err % "\n"; + error += err + "\n"; return QImage(); } // release the file @@ -212,7 +212,7 @@ const QImage PQCImagePluginVideo::loadImage(QString path, QSize requestedSize, Q if(!tempFile.open()) { const QString err = "Unable to open temporary file from thumbnail generation."; qWarning() << err; - error += err % "\n"; + error += err + "\n"; return QImage(); } @@ -238,7 +238,7 @@ const QImage PQCImagePluginVideo::loadImage(QString path, QSize requestedSize, Q if(!tmp_file.open()) { const QString msg = "Failed to create temporary file"; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } @@ -251,7 +251,7 @@ const QImage PQCImagePluginVideo::loadImage(QString path, QSize requestedSize, Q if(ret != 0) { const QString msg = QString("ffmpegthumbnailer ended with error code %1 - is it installed?").arg(ret); - error += msg % "\n"; + error += msg + "\n"; qWarning() << msg; return QImage(); } @@ -276,14 +276,14 @@ const QImage PQCImagePluginVideo::loadImage(QString path, QSize requestedSize, Q const QString msg = "No video thumbnailer selected"; qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); } const QString msg = "Unknown video thumbnailer used: " + PQCSettingsCPP::get().getFiletypesVideoThumbnailer(); qWarning() << msg; - error += msg % "\n"; + error += msg + "\n"; return QImage(); diff --git a/cplusplus/images/provider/pqc_providerfolderthumb.cpp b/cplusplus/images/provider/pqc_providerfolderthumb.cpp index 10808f81d..8fc5aa41b 100644 --- a/cplusplus/images/provider/pqc_providerfolderthumb.cpp +++ b/cplusplus/images/provider/pqc_providerfolderthumb.cpp @@ -67,14 +67,14 @@ const QString PQCAsyncImageResponseFolderThumbCache::generateCacheKey(QString fo const int ascending = useDefaultSort ? settings.getImageviewSortImagesAscending() : settings.getFiledialogFolderContentThumbnailsSortAscending(); return foldername - % "::" - % QString::number(numEnabledFormats) - % "::" - % QString::number(QFileInfo(foldername).lastModified().toMSecsSinceEpoch()) - % "::" - % sortBy - % "::" - % QString::number(ascending ? 1 : 0); + + "::" + + QString::number(numEnabledFormats) + + "::" + + QString::number(QFileInfo(foldername).lastModified().toMSecsSinceEpoch()) + + "::" + + sortBy + + "::" + + QString::number(ascending ? 1 : 0); } diff --git a/cplusplus/images/provider/pqc_providericon.cpp b/cplusplus/images/provider/pqc_providericon.cpp index ee8bb7127..2de7acca5 100644 --- a/cplusplus/images/provider/pqc_providericon.cpp +++ b/cplusplus/images/provider/pqc_providericon.cpp @@ -54,12 +54,12 @@ QImage PQCProviderIcon::requestImage(const QString &icon, QSize *origSize, const QString iconname = ":/filetypes/unknown.svg"; if(suf.startsWith("network_")) iconname = ":/filetypes/network_unknown.svg"; - if(QFile::exists(":/filetypes/" % suf % ".svg")) - iconname = ":/filetypes/" % suf % ".svg"; + if(QFile::exists(":/filetypes/" + suf + ".svg")) + iconname = ":/filetypes/" + suf + ".svg"; else if(suf.contains(".")) { - const QString suf2 = (suf.startsWith("network_") ? "network_" : "") % suf.split(".").last(); - if(QFile::exists(":/filetypes/" % suf2 % ".svg")) - iconname = ":/filetypes/" % suf2 % ".svg"; + const QString suf2 = (suf.startsWith("network_") ? "network_" : "") + suf.split(".").last(); + if(QFile::exists(":/filetypes/" + suf2 + ".svg")) + iconname = ":/filetypes/" + suf2 + ".svg"; } return svg->requestImage(iconname, origSize, requestedSize); diff --git a/cplusplus/images/provider/pqc_providertheme.cpp b/cplusplus/images/provider/pqc_providertheme.cpp index e70e410e7..8574f5b6a 100644 --- a/cplusplus/images/provider/pqc_providertheme.cpp +++ b/cplusplus/images/provider/pqc_providertheme.cpp @@ -36,17 +36,17 @@ PQCProviderTheme::PQCProviderTheme() : QQuickImageProvider(QQuickImageProvider:: // this is needed to 'fix' the icons on Linux if(PQCSettingsCPP::get().getGeneralInterfaceVariant() == "modern") { if(QColor(PQCSettingsCPP::get().getInterfaceAccentColor()).lightness() > 96) - QIcon::setThemeName(origTheme % "-light"); + QIcon::setThemeName(origTheme + "-light"); else - QIcon::setThemeName(origTheme % "-dark"); + QIcon::setThemeName(origTheme + "-dark"); QIcon::setFallbackThemeName(origTheme); } connect(&PQCSettingsCPP::get(), &PQCSettingsCPP::interfaceAccentColorChanged, this, [this]() { if(PQCSettingsCPP::get().getGeneralInterfaceVariant() == "modern") { if(QColor(PQCSettingsCPP::get().getInterfaceAccentColor()).lightness() > 96) - QIcon::setThemeName(origTheme % "-light"); + QIcon::setThemeName(origTheme + "-light"); else - QIcon::setThemeName(origTheme % "-dark"); + QIcon::setThemeName(origTheme + "-dark"); QIcon::setFallbackThemeName(origTheme); } }); @@ -90,11 +90,11 @@ QImage PQCProviderTheme::requestImage(const QString &icon, QSize *origSize, cons QString iconname = ":/filetypes/unknown.svg"; - const QString firstName = ":/filetypes/" % suf % ".svg"; + const QString firstName = ":/filetypes/" + suf + ".svg"; if(suf != "folder" && QFile(firstName).exists()) iconname = firstName; else { - const QString secondName = ":/other/filedialog-" % suf % ".svg"; + const QString secondName = ":/other/filedialog-" + suf + ".svg"; if(QFile(secondName).exists()) iconname = secondName; else if(suf.contains("folder") || suf.contains("directory")) diff --git a/cplusplus/images/provider/pqc_providerthumb.cpp b/cplusplus/images/provider/pqc_providerthumb.cpp index 037fde2ea..6422de851 100644 --- a/cplusplus/images/provider/pqc_providerthumb.cpp +++ b/cplusplus/images/provider/pqc_providerthumb.cpp @@ -172,7 +172,7 @@ void PQCAsyncImageResponseThumb::loadImage() { } - const QString thumbcachepath = PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/" % cachedir % "/" % md5 % ".png"; + const QString thumbcachepath = PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/" + cachedir + "/" + md5 + ".png"; // If files in XDG_CACHE_HOME/thumbnails/ shall be used, then do use them if(PQCSettingsCPP::get().getThumbnailsCache()) { @@ -220,8 +220,8 @@ void PQCAsyncImageResponseThumb::loadImage() { const QString suf = QFileInfo(filenameForChecking).suffix().toLower(); QString iconname = ":/filetypes/unknown.svg"; - if(QFile::exists(":/filetypes/"% suf % ".svg")) - iconname = ":/filetypes/" % suf % ".svg"; + if(QFile::exists(":/filetypes/" + suf + ".svg")) + iconname = ":/filetypes/" + suf + ".svg"; QSvgRenderer svg; if(!svg.load(iconname)) @@ -261,7 +261,7 @@ void PQCAsyncImageResponseThumb::loadImage() { dir.mkpath(info.absolutePath()); // Set some required (and additional) meta information - p.setText("Thumb::URI", "file://" % filename); + p.setText("Thumb::URI", "file://" + filename); p.setText("Thumb::MTime", QString::number(QFileInfo(filenameForChecking).lastModified().toSecsSinceEpoch())); QString mime = mimedb.mimeTypeForFile(filenameForChecking, QMimeDatabase::MatchContent).name(); // this is the default mime type if no mime type is available or file cannot be found diff --git a/cplusplus/main.cpp b/cplusplus/main.cpp index e36b583e1..ebe0a9762 100644 --- a/cplusplus/main.cpp +++ b/cplusplus/main.cpp @@ -252,9 +252,9 @@ int main(int argc, char **argv) { bool success = true; for(QScreen *screen : screens) { const QPixmap pixmap = screen->grabWindow(0); - QDir d(PQCConfigFiles::get().CACHE_DIR() % "/screenshots/"); + QDir d(PQCConfigFiles::get().CACHE_DIR() + "/screenshots/"); d.mkdir(d.absolutePath()); - const QString fn = d.absolutePath() % "/" % QString::number(index) % ".jpg"; + const QString fn = d.absolutePath() + "/" + QString::number(index) + ".jpg"; if(pixmap.isNull() || !pixmap.save(fn)) { qWarning() << "Failed to store screenshot of screen" << index << "to" << fn; success = false; diff --git a/cplusplus/other/pqc_singleinstance.cpp b/cplusplus/other/pqc_singleinstance.cpp index 3a0101ae2..5df64baff 100644 --- a/cplusplus/other/pqc_singleinstance.cpp +++ b/cplusplus/other/pqc_singleinstance.cpp @@ -251,7 +251,7 @@ PQCSingleInstance::PQCSingleInstance(int &argc, char *argv[]) : QApplication(arg QString token = qgetenv("XDG_ACTIVATION_TOKEN"); if(!token.isEmpty()) - writeMessage.append(("_T_O_K_E_N_" % token % "\n").toUtf8()); + writeMessage.append(("_T_O_K_E_N_" + token + "\n").toUtf8()); } else writeMessage.reserve(msg.size()); @@ -262,11 +262,11 @@ PQCSingleInstance::PQCSingleInstance(int &argc, char *argv[]) : QApplication(arg // Send composed message string if(receivedFiles.length()) - writeMessage.append(("_F_I_L_E_" % receivedFiles.join(":://:://::") % "\n").toUtf8()); + writeMessage.append(("_F_I_L_E_" + receivedFiles.join(":://:://::") + "\n").toUtf8()); if(!receivedShortcut.isEmpty()) - writeMessage.append(("_S_H_O_R_T_C_U_T_" % receivedShortcut % "\n").toUtf8()); + writeMessage.append(("_S_H_O_R_T_C_U_T_" + receivedShortcut + "\n").toUtf8()); if(!receivedSetting[0].isEmpty()) - writeMessage.append(("_S_E_T_T_I_N_G_" % receivedSetting[0] % ":" % receivedSetting[1] % "\n").toUtf8()); + writeMessage.append(("_S_E_T_T_I_N_G_" + receivedSetting[0] + ":" + receivedSetting[1] + "\n").toUtf8()); socket->write(writeMessage.join('\n')); socket->flush(); @@ -530,7 +530,7 @@ PQCSingleInstance::~PQCSingleInstance() { bool PQCSingleInstance::importConfig() { // no import is to be done - const QString importFN = PQCConfigFiles::get().CONFIG_DIR() % "/to_be_imported.pqt"; + const QString importFN = PQCConfigFiles::get().CONFIG_DIR() + "/to_be_imported.pqt"; if(!QFile::exists(importFN)) return true; @@ -623,7 +623,7 @@ bool PQCSingleInstance::importConfig() { if(filenameinside == "CFG_IMAGEPLUGINS") { // write to temporary file - const QString ipArchive = PQCConfigFiles::get().CONFIG_DIR() % "/to_be_imported_imageplugins.pqt"; + const QString ipArchive = PQCConfigFiles::get().CONFIG_DIR() + "/to_be_imported_imageplugins.pqt"; QFile file(ipArchive); // overwrite old content if(!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { @@ -635,7 +635,7 @@ bool PQCSingleInstance::importConfig() { file.close(); file.flush(); - if(!PQCHelper::unzipDirectory(ipArchive, PQCConfigFiles::get().CONFIG_DIR() % "/imageplugins/")) { + if(!PQCHelper::unzipDirectory(ipArchive, PQCConfigFiles::get().CONFIG_DIR() + "/imageplugins/")) { qWarning() << "Failed to import imageplugins config!"; } diff --git a/cplusplus/other/pqc_startuphandler.cpp b/cplusplus/other/pqc_startuphandler.cpp index a9d5ec960..7523f92ed 100644 --- a/cplusplus/other/pqc_startuphandler.cpp +++ b/cplusplus/other/pqc_startuphandler.cpp @@ -462,10 +462,10 @@ void PQCStartupHandler::setupFresh() { dir.mkpath(PQCConfigFiles::get().CACHE_DIR()); dir.mkpath(QFileInfo(PQCConfigFiles::get().USER_PLACES_XBEL()).absolutePath()); dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR()); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/normal/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/x-large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/xx-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/normal/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/x-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/xx-large/"); /**************************************************************/ // create default settings database @@ -513,7 +513,7 @@ void PQCStartupHandler::setupFresh() { /**************************************************************/ // make sure no old image format settings remain - const QString imageplugindir = PQCConfigFiles::get().CONFIG_DIR() % "/imageplugins"; + const QString imageplugindir = PQCConfigFiles::get().CONFIG_DIR() + "/imageplugins"; if(QFileInfo::exists(imageplugindir)) { dir.setPath(imageplugindir); dir.removeRecursively(); diff --git a/cplusplus/other/startuphandler/pqc_migrateimageplugins.cpp b/cplusplus/other/startuphandler/pqc_migrateimageplugins.cpp index f298934f1..8ada4ed3c 100644 --- a/cplusplus/other/startuphandler/pqc_migrateimageplugins.cpp +++ b/cplusplus/other/startuphandler/pqc_migrateimageplugins.cpp @@ -43,7 +43,7 @@ void PQCMigrateImagePlugins::migrate540() { qDebug() << ""; - const QString fn = PQCConfigFiles::get().CONFIG_DIR() % "/imageformats.db"; + const QString fn = PQCConfigFiles::get().CONFIG_DIR() + "/imageformats.db"; if(!QFileInfo::exists(fn)) return; @@ -75,8 +75,8 @@ void PQCMigrateImagePlugins::migrate540() { QSqlDatabase::removeDatabase("oldimageformats"); // try to backup file and remove it then to never re-migrate it - QFile::remove(fn % ".bak"); - QFile::copy(fn, fn % ".bak"); + QFile::remove(fn + ".bak"); + QFile::copy(fn, fn + ".bak"); QFile::remove(fn); } diff --git a/cplusplus/other/startuphandler/pqc_validate.cpp b/cplusplus/other/startuphandler/pqc_validate.cpp index f8416faf3..ca740ca56 100644 --- a/cplusplus/other/startuphandler/pqc_validate.cpp +++ b/cplusplus/other/startuphandler/pqc_validate.cpp @@ -97,19 +97,19 @@ bool PQCValidate::validateDirectories(const QString &thumb_cache_basedir) { dir.mkpath(PQCConfigFiles::get().CACHE_DIR()); dir.mkpath(PQCConfigFiles::get().DATA_DIR()); dir.mkpath(userplaces_info.absolutePath()); - dir.mkpath(PQCConfigFiles::get().CONFIG_DIR() % "/imageplugins/"); + dir.mkpath(PQCConfigFiles::get().CONFIG_DIR() + "/imageplugins/"); if(!thumb_cache_basedir.isEmpty()) { dir.mkpath(thumb_cache_basedir); - dir.mkpath(thumb_cache_basedir % "/normal/"); - dir.mkpath(thumb_cache_basedir % "/large/"); - dir.mkpath(thumb_cache_basedir % "/x-large/"); - dir.mkpath(thumb_cache_basedir % "/xx-large/"); + dir.mkpath(thumb_cache_basedir + "/normal/"); + dir.mkpath(thumb_cache_basedir + "/large/"); + dir.mkpath(thumb_cache_basedir + "/x-large/"); + dir.mkpath(thumb_cache_basedir + "/xx-large/"); } else { dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR()); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/normal/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/x-large/"); - dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() % "/xx-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/normal/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/x-large/"); + dir.mkpath(PQCConfigFiles::get().THUMBNAIL_CACHE_DIR() + "/xx-large/"); } // In a previous version the user-places.xbel file was created as directory instead. diff --git a/cplusplus/singletons/scripts/pqc_scriptschromecast.cpp b/cplusplus/singletons/scripts/pqc_scriptschromecast.cpp index 2b6522f8b..c0aaffc2e 100644 --- a/cplusplus/singletons/scripts/pqc_scriptschromecast.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptschromecast.cpp @@ -54,9 +54,9 @@ PQCScriptsChromeCast::~PQCScriptsChromeCast() { disconnect(); - QFile::remove(QDir::tempPath() % "/chromecast_discovery.py"); - QFile::remove(QDir::tempPath() % "/chromecast_cast.py"); - QFile::remove(QDir::tempPath() % "/chromecast_disconnect.py"); + QFile::remove(QDir::tempPath() + "/chromecast_discovery.py"); + QFile::remove(QDir::tempPath() + "/chromecast_cast.py"); + QFile::remove(QDir::tempPath() + "/chromecast_disconnect.py"); server->deleteLater(); procDiscovery->deleteLater(); @@ -100,7 +100,7 @@ bool PQCScriptsChromeCast::startDiscovery() { m_inDiscovery = true; Q_EMIT inDiscoveryChanged(); - const QString tmpPath = QDir::tempPath() % "/chromecast_discovery.py"; + const QString tmpPath = QDir::tempPath() + "/chromecast_discovery.py"; QFile::remove(tmpPath); if(!QFile::copy(":/chromecast_discovery.py", tmpPath)) { @@ -176,7 +176,7 @@ bool PQCScriptsChromeCast::castImage(QString filename) { if(filename.isEmpty()) { QImage img(":/other/logo_chromecast.jpg"); - if(!img.save(QDir::tempPath() % "/photoqtchromecast.jpg", nullptr, 100)) { + if(!img.save(QDir::tempPath() + "/photoqtchromecast.jpg", nullptr, 100)) { qWarning() << "Failed to save default image."; return false; } @@ -197,12 +197,12 @@ bool PQCScriptsChromeCast::castImage(QString filename) { QPainter painter(&ret); painter.drawImage((1920-img.width())/2, (1080-img.height())/2, img); painter.end(); - if(!ret.save(QDir::tempPath() % "/photoqtchromecast.jpg", nullptr, 100)) { + if(!ret.save(QDir::tempPath() + "/photoqtchromecast.jpg", nullptr, 100)) { qWarning() << "Failed to save image:" << filename; return false; } } else { - if(!img.save(QDir::tempPath() % "/photoqtchromecast.jpg", nullptr, 100)) { + if(!img.save(QDir::tempPath() + "/photoqtchromecast.jpg", nullptr, 100)) { qWarning() << "Failed to save image:" << filename; return false; } @@ -229,7 +229,7 @@ bool PQCScriptsChromeCast::disconnect() { if(!m_connected) return true; - const QString pyPath = QDir::tempPath() % "/chromecast_disconnect.py"; + const QString pyPath = QDir::tempPath() + "/chromecast_disconnect.py"; QFile::remove(pyPath); if(!QFile::copy(":/chromecast_disconnect.py", pyPath)) { qWarning() << "ERROR preparing disconnect python script, chromecast won't properly shut down"; diff --git a/cplusplus/singletons/scripts/pqc_scriptscolorprofiles.cpp b/cplusplus/singletons/scripts/pqc_scriptscolorprofiles.cpp index aeb2f8eff..1a9294f0e 100644 --- a/cplusplus/singletons/scripts/pqc_scriptscolorprofiles.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptscolorprofiles.cpp @@ -45,7 +45,7 @@ void PQCScriptsColorProfiles::loadColorProfileInfo() { QDirIterator it(PQCConfigFiles::get().ICC_COLOR_PROFILE_DIR(), {"*.icc", "*.icm", "*.ICC", "*.ICM"}, QDir::Files, QDirIterator::Subdirectories); while(it.hasNext()) { - QByteArray fullpath = QFile::encodeName(PQCConfigFiles::get().ICC_COLOR_PROFILE_DIR() % "/" % it.next()); + QByteArray fullpath = QFile::encodeName(PQCConfigFiles::get().ICC_COLOR_PROFILE_DIR() + "/" + it.next()); cmsHPROFILE profile = cmsOpenProfileFromFile(fullpath.constData(), "r"); if(!profile) { @@ -129,7 +129,7 @@ void PQCScriptsColorProfiles::loadColorProfileInfo() { QColorSpace sp = QColorSpace::fromIccProfile(iccfile.readAll()); if(sp.isValid()) { m_externalColorProfiles << fn; - m_externalColorProfileDescriptions << sp.description() % " (system)"; + m_externalColorProfileDescriptions << sp.description() + " (system)"; } } } @@ -329,7 +329,7 @@ bool PQCScriptsColorProfiles::importColorProfile() { } } - const QString targetFN = PQCConfigFiles::get().ICC_COLOR_PROFILE_DIR() % "/" % info.fileName(); + const QString targetFN = PQCConfigFiles::get().ICC_COLOR_PROFILE_DIR() + "/" + info.fileName(); if(QFile::exists(targetFN)) QFile::remove(targetFN); diff --git a/cplusplus/singletons/scripts/pqc_scriptsconfig.cpp b/cplusplus/singletons/scripts/pqc_scriptsconfig.cpp index 6b6aaf14d..4f9e86cbe 100644 --- a/cplusplus/singletons/scripts/pqc_scriptsconfig.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptsconfig.cpp @@ -107,85 +107,85 @@ QString PQCScriptsConfig::getConfigInfo(bool formatHTML) { QString txt = ""; - txt += " - Compiled with " % bold1 % "Qt " % QT_VERSION_STR % bold2 % ", running with " % bold1 % "Qt " % qVersion() % bold2 % nl; + txt += " - Compiled with " + bold1 + "Qt " + QT_VERSION_STR + bold2 + ", running with " + bold1 + "Qt " + qVersion() + bold2 + nl; #ifdef PQMPORTABLETWEAKS - txt += " - Portable version" % nl; + txt += " - Portable version" + nl; #endif #ifdef PQMEXIV2 - txt += " - " % bold1 % "Exiv2" % bold2 % ": " % Exiv2::version() % nl; + txt += " - " + bold1 + "Exiv2" + bold2 + ": " + Exiv2::version() + nl; #endif #ifdef PQMPUGIXML - txt += " - " % bold1 % "pugixml" % bold2 % ": " % QString::number((PUGIXML_VERSION)/1000.) % nl; + txt += " - " + bold1 + "pugixml" + bold2 + ": " + QString::number((PUGIXML_VERSION)/1000.) + nl; #endif #ifdef PQMCHROMECAST - txt += " - " % bold1 % "Chromecast" % bold2 % nl; + txt += " - " + bold1 + "Chromecast" + bold2 + nl; #endif #ifdef PQMRAW - txt += " - " % bold1 % "LibRaw" % bold2 % ": " % LibRaw::version() % nl; + txt += " - " + bold1 + "LibRaw" + bold2 + ": " + LibRaw::version() + nl; #endif #ifdef PQMPOPPLER - txt += " - " % bold1 % "Poppler" % bold2 % ": " % POPPLER_VERSION % nl; + txt += " - " + bold1 + "Poppler" + bold2 + ": " + POPPLER_VERSION + nl; #endif #ifdef PQMQTPDF - txt += " - " % bold1 % "QtPDF" % bold2 % nl; + txt += " - " + bold1 + "QtPDF" + bold2 + nl; #endif #ifdef PQMLIBARCHIVE - txt += " - " % bold1 % "LibArchive" % bold2 % ": " % ARCHIVE_VERSION_ONLY_STRING % nl; + txt += " - " + bold1 + "LibArchive" + bold2 + ": " + ARCHIVE_VERSION_ONLY_STRING + nl; #endif #ifdef PQMIMAGEMAGICK - txt += " - " % bold1 % "ImageMagick" % bold2 % ": " % MagickLibVersionText % nl; + txt += " - " + bold1 + "ImageMagick" + bold2 + ": " + MagickLibVersionText + nl; #endif #ifdef PQMGRAPHICSMAGICK - txt += " - " % bold1 % "GraphicsMagick" % bold2 % ": " % MagickLibVersionText % nl; + txt += " - " + bold1 + "GraphicsMagick" + bold2 + ": " + MagickLibVersionText + nl; #endif #ifdef PQMDEVIL - txt += " - " % bold1 % "DevIL" % bold2 % ": " % QString::number(IL_VERSION) % nl; + txt += " - " + bold1 + "DevIL" + bold2 + ": " + QString::number(IL_VERSION) + nl; #endif #ifdef PQMLIBSAI - txt += " - " % bold1 % "LibSai" % bold2 % nl; + txt += " - " + bold1 + "LibSai" + bold2 + nl; #endif #ifdef PQMLOCATION - txt += " - " % bold1 % "Location" % bold2 % nl; + txt += " - " + bold1 + "Location" + bold2 + nl; #endif #ifdef PQMMOTIONPHOTO - txt += " - " % bold1 % "Motion Photo" % bold2 % nl; + txt += " - " + bold1 + "Motion Photo" + bold2 + nl; #endif #ifdef PQMVIDEOQT - txt += " - " % bold1 % "Video" % bold2 % " through Qt" % nl; + txt += " - " + bold1 + "Video" + bold2 + " through Qt" + nl; #endif #ifdef PQMLCMS2 - txt += " - " % bold1 % "LittleCMS" % bold2 % ": " % QString::number(LCMS_VERSION) % nl; + txt += " - " + bold1 + "LittleCMS" + bold2 + ": " + QString::number(LCMS_VERSION) + nl; #endif #ifdef PQMVIDEOMPV mpv_handle *mpv = mpv_create(); if(mpv_initialize(mpv) < 0) throw std::runtime_error("could not initialize mpv context"); - txt += " - " % bold1 % "libmpv" % bold2 % ": " % mpv::qt::get_property(mpv, "mpv-version").toString() % " (ffmpeg: " % mpv::qt::get_property(mpv, "ffmpeg-version").toString() % ")" % nl; + txt += " - " + bold1 + "libmpv" + bold2 + ": " + mpv::qt::get_property(mpv, "mpv-version").toString() + " (ffmpeg: " + mpv::qt::get_property(mpv, "ffmpeg-version").toString() + ")" + nl; #endif - txt += " - " % bold1 % "Qt" % bold2 % " image formats available:" % spacing % nl; + txt += " - " + bold1 + "Qt" + bold2 + " image formats available:" + spacing + nl; QImageReader reader; auto formats = reader.supportedImageFormats(); for(int i = 0; i < formats.length(); ++i) { if(i != 0 && i%10 == 0) - txt += nl % spacing; + txt += nl + spacing; txt += QString("%1, ").arg(QString(formats[i]), 5); } @@ -214,7 +214,7 @@ bool PQCScriptsConfig::exportConfigTo(QString path) { if(path.isEmpty()) { archiveFile = QFileDialog::getSaveFileName(0, "Select Location", - QDir::homePath() % "/photoqtconfig.pqt", + QDir::homePath() + "/photoqtconfig.pqt", "PhotoQt Config File (*.pqt);;All Files (*.*)"); if(archiveFile.trimmed().isEmpty()) return false; @@ -237,7 +237,7 @@ bool PQCScriptsConfig::exportConfigTo(QString path) { qWarning() << "Unable to create temporary file"; return false; } - PQCHelper::zipDirectory(PQCConfigFiles::get().CONFIG_DIR()%"/imageplugins/", tempfile.fileName()); + PQCHelper::zipDirectory(PQCConfigFiles::get().CONFIG_DIR()+"/imageplugins/", tempfile.fileName()); allfiles["CFG_IMAGEPLUGINS"] = tempfile.fileName(); // handler to the file @@ -395,7 +395,7 @@ bool PQCScriptsConfig::importConfigFrom(QString path) { if(r != ARCHIVE_OK) qWarning() << "ERROR: archive_read_free() returned code of" << r; - const QString newPath = PQCConfigFiles::get().CONFIG_DIR() % "/to_be_imported.pqt"; + const QString newPath = PQCConfigFiles::get().CONFIG_DIR() + "/to_be_imported.pqt"; if(QFile::exists(newPath)) { if(!QFile::remove(newPath)) { qWarning() << "Unable to remove special import file, something went very wrong!"; @@ -651,7 +651,7 @@ bool PQCScriptsConfig::askForConfirmation(QString title, QString text, QString i } bool PQCScriptsConfig::setInterfaceForNextStartup(QString variant) { - QFile file(PQCConfigFiles::get().CACHE_DIR() % "/nextstartupvariant"); + QFile file(PQCConfigFiles::get().CACHE_DIR() + "/nextstartupvariant"); if(!file.open(QIODevice::WriteOnly|QIODevice::Truncate)) { qWarning() << "Unable to toggle interface variant"; return false; @@ -663,7 +663,7 @@ bool PQCScriptsConfig::setInterfaceForNextStartup(QString variant) { } QString PQCScriptsConfig::getInterfaceForNextStartup() { - QFile file(PQCConfigFiles::get().CACHE_DIR() % "/nextstartupvariant"); + QFile file(PQCConfigFiles::get().CACHE_DIR() + "/nextstartupvariant"); if(!file.exists()) return ""; if(!file.open(QIODevice::ReadOnly)) { qWarning() << "Unable to read toggled interface variant"; diff --git a/cplusplus/singletons/scripts/pqc_scriptsfilemanagement.cpp b/cplusplus/singletons/scripts/pqc_scriptsfilemanagement.cpp index 3d7943467..95b74e6a5 100644 --- a/cplusplus/singletons/scripts/pqc_scriptsfilemanagement.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptsfilemanagement.cpp @@ -78,7 +78,7 @@ bool PQCScriptsFileManagement::copyFileToHere(QString filename, QString targetdi if(!info.exists()) return false; - QString targetFilename = targetdir % "/" % info.fileName(); + QString targetFilename = targetdir + "/" + info.fileName(); // file copied to itself if(targetFilename == filename) @@ -177,8 +177,8 @@ bool PQCScriptsFileManagement::renameFile(QString dir, QString oldName, QString qDebug() << "args: oldName =" << oldName; qDebug() << "args: newName =" << newName; - QFile file(dir % "/" % oldName); - return file.rename(dir % "/" % newName); + QFile file(dir + "/" + oldName); + return file.rename(dir + "/" + newName); } @@ -270,14 +270,14 @@ QString PQCScriptsFileManagement::undoLastAction(QString action) { QFile delFile(act.at(1).toString()); QFileInfo info(act.at(1).toString()); - QFile infoFile(QDir::cleanPath(info.absolutePath() % "/../info/" % info.fileName() % ".trashinfo")); + QFile infoFile(QDir::cleanPath(info.absolutePath() + "/../info/" + info.fileName() + ".trashinfo")); if(origFile.exists()) { // re-add action to list undoTrash.push_back(act); - return "-" % tr("File with original filename exists already", "filemanagement"); + return "-" + tr("File with original filename exists already", "filemanagement"); } @@ -298,10 +298,10 @@ QString PQCScriptsFileManagement::undoLastAction(QString action) { // re-add action to list undoTrash.push_back(act); - return "-" % tr("Failed to recover file") % ": " % act.at(0).toString(); + return "-" + tr("Failed to recover file") + ": " + act.at(0).toString(); } - return "-" % tr("Unknown action") % ": " % action; + return "-" + tr("Unknown action") + ": " + action; } diff --git a/cplusplus/singletons/scripts/pqc_scriptsfilespaths.cpp b/cplusplus/singletons/scripts/pqc_scriptsfilespaths.cpp index 6b928e2dd..9cc8aa86d 100644 --- a/cplusplus/singletons/scripts/pqc_scriptsfilespaths.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptsfilespaths.cpp @@ -210,7 +210,7 @@ QString PQCScriptsFilesPaths::getFullArchivePath(QString path) { const int idx2 = path.indexOf("::ARC::"); if(idx2 != -1) - return path.mid(idx+7) % " (" % QString::number(path.mid(0,idx).toInt()+1) % ")"; + return path.mid(idx+7) + " (" + QString::number(path.mid(0,idx).toInt()+1) + ")"; return path; } @@ -475,9 +475,9 @@ QString PQCScriptsFilesPaths::selectFileFromDialog(QString buttonlabel, QString if(!confirmOverwrite) diag.setOption(QFileDialog::DontConfirmOverwrite); diag.setOption(QFileDialog::DontUseNativeDialog, false); - diag.setNameFilter("*." % suffix % ";;All Files (*.*)"); + diag.setNameFilter("*." + suffix + ";;All Files (*.*)"); diag.setDirectory(info.absolutePath()); - diag.selectFile(info.completeBaseName() % "." % info.completeSuffix()); + diag.selectFile(info.completeBaseName() + "." + info.completeSuffix()); if(diag.exec()) { QStringList fileNames = diag.selectedFiles(); @@ -485,7 +485,7 @@ QString PQCScriptsFilesPaths::selectFileFromDialog(QString buttonlabel, QString QString fn = fileNames[0]; QFileInfo newinfo(fn); if(newinfo.suffix().isEmpty()) - return (fn % "." % suffix); + return (fn + "." + suffix); return fn; } } @@ -525,7 +525,7 @@ void PQCScriptsFilesPaths::saveLogToFile(QString txt) { qDebug() << "args: txt.length = " << txt.length(); - QString newfile = QFileDialog::getSaveFileName(nullptr, QString(), QDir::homePath() % "/photoqt-" % QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm") % ".log"); + QString newfile = QFileDialog::getSaveFileName(nullptr, QString(), QDir::homePath() + "/photoqt-" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm") + ".log"); if(newfile.isEmpty()) { return; @@ -572,7 +572,7 @@ QStringList PQCScriptsFilesPaths::openFilesFromDialog(QString buttonlabel, QStri diag.setAcceptMode(QFileDialog::AcceptOpen); diag.setOption(QFileDialog::DontUseNativeDialog, false); if(endings.size() > 0) - diag.setNameFilter("*." % PQCHelper::setJoin(endings, " *.") % ";;All Files (*.*)"); + diag.setNameFilter("*." + PQCHelper::setJoin(endings, " *.") + ";;All Files (*.*)"); if(info.isFile()) { diag.setDirectory(info.absolutePath()); diag.selectFile(info.fileName()); @@ -609,7 +609,7 @@ QString PQCScriptsFilesPaths::createTooltipFilename(const QString fname) { // if it is too long, then the new character is moved to a new line if(metrics.horizontalAdvance(testLine) > 200) { - result += currentLine % "\n"; + result += currentLine + "\n"; currentLine = c; } else { currentLine += c; @@ -640,7 +640,7 @@ QString PQCScriptsFilesPaths::findDropBoxFolder() { // https://stackoverflow.com/questions/12118162/how-to-determine-the-dropbox-folder-location-programmatically #ifdef Q_OS_UNIX - QFile f(QDir::homePath() % "/.dropbox/host.db"); + QFile f(QDir::homePath() + "/.dropbox/host.db"); #else QFile f(QString("%1/Dropbox/host.db").arg(QStandardPaths::AppDataLocation)); #endif @@ -664,7 +664,7 @@ QString PQCScriptsFilesPaths::findNextcloudFolder() { #if defined Q_OS_UNIX || defined Q_OS_WIN #if defined Q_OS_UNIX - QFile f(QDir::homePath() % "/.config/Nextcloud/nextcloud.cfg"); + QFile f(QDir::homePath() + "/.config/Nextcloud/nextcloud.cfg"); #elif defined Q_OS_WIN QFile f(QString("%1/Nextcloud/nextcloud.cfg").arg(QStandardPaths::AppDataLocation)); #endif @@ -691,7 +691,7 @@ QString PQCScriptsFilesPaths::findOwnCloudFolder() { #if defined Q_OS_UNIX || defined Q_OS_WIN #if defined Q_OS_UNIX - QFile f(QDir::homePath() % "/.config/ownCloud/owncloud.cfg"); + QFile f(QDir::homePath() + "/.config/ownCloud/owncloud.cfg"); #elif defined Q_OS_WIN QFile f(QString("%1/ownCloud/owncloud.cfg").arg(QStandardPaths::AppDataLocation)); #endif @@ -733,12 +733,12 @@ QString PQCScriptsFilesPaths::handleAnimatedImagePathAndEncode(QString path) { if(info.size() > 268435456) return toPercentEncoding(path); - const QString tempdir = PQCConfigFiles::get().CACHE_DIR() % "/animatedfiles"; + const QString tempdir = PQCConfigFiles::get().CACHE_DIR() + "/animatedfiles"; QDir dir(tempdir); if(!dir.exists()) dir.mkdir(tempdir); - QString targetFilename = PQCConfigFiles::get().CACHE_DIR() % "/animatedfiles/temp" % QString::number(animatedImageTemporaryCounter) % "." % info.suffix(); + QString targetFilename = PQCConfigFiles::get().CACHE_DIR() + "/animatedfiles/temp" + QString::number(animatedImageTemporaryCounter) + "." + info.suffix(); QFileInfo targetinfo(targetFilename); animatedImageTemporaryCounter = (animatedImageTemporaryCounter+1)%5; @@ -764,23 +764,23 @@ QString PQCScriptsFilesPaths::handleAnimatedImagePathAndEncode(QString path) { void PQCScriptsFilesPaths::cleanupTemporaryFiles() { - QDir dir(PQCConfigFiles::get().CACHE_DIR() % "%1/animatedfiles"); + QDir dir(PQCConfigFiles::get().CACHE_DIR() + "%1/animatedfiles"); if(dir.exists()) dir.removeRecursively(); - dir.setPath(PQCConfigFiles::get().CACHE_DIR() % "/archive/"); + dir.setPath(PQCConfigFiles::get().CACHE_DIR() + "/archive/"); if(dir.exists()) dir.removeRecursively(); - dir.setPath(PQCConfigFiles::get().CACHE_DIR() % "/clipboard/"); + dir.setPath(PQCConfigFiles::get().CACHE_DIR() + "/clipboard/"); if(dir.exists()) dir.removeRecursively(); - dir.setPath(PQCConfigFiles::get().CACHE_DIR() % "/motionphotos/"); + dir.setPath(PQCConfigFiles::get().CACHE_DIR() + "/motionphotos/"); if(dir.exists()) dir.removeRecursively(); - dir.setPath(PQCConfigFiles::get().CACHE_DIR() % "/screenshots/"); + dir.setPath(PQCConfigFiles::get().CACHE_DIR() + "/screenshots/"); if(dir.exists()) dir.removeRecursively(); @@ -847,7 +847,7 @@ QString PQCScriptsFilesPaths::getSiblingFile(const QString currentFile, const in // check all previous directories one by one for(int i = currentIndex-1; i >= 0; --i) { - siblingFile = _findFirstFileinFolderAndSubFolder(prefixDir.absolutePath() % "/" % parentSiblings.at(i), false, remainingIteration, remainingLevelDown); + siblingFile = _findFirstFileinFolderAndSubFolder(prefixDir.absolutePath() + "/" + parentSiblings.at(i), false, remainingIteration, remainingLevelDown); // if we found a file or reached maximum iteration level: stop if(!siblingFile.isEmpty() || remainingIteration <= 0) break; } @@ -857,7 +857,7 @@ QString PQCScriptsFilesPaths::getSiblingFile(const QString currentFile, const in // check all next directories one by one for(int i = currentIndex+1; i < parentSiblings.length(); ++i) { - siblingFile = _findFirstFileinFolderAndSubFolder(prefixDir.absolutePath() % "/" % parentSiblings.at(i), true, remainingIteration, remainingLevelDown); + siblingFile = _findFirstFileinFolderAndSubFolder(prefixDir.absolutePath() + "/" + parentSiblings.at(i), true, remainingIteration, remainingLevelDown); // if we found a file or reached maximum iteration level: stop if(!siblingFile.isEmpty() || remainingIteration <= 0) break; } @@ -894,7 +894,7 @@ QString PQCScriptsFilesPaths::_findFirstFileinFolderAndSubFolder(const QString f for(const QString &f : std::as_const(fileList)) { - const QString fullPath = dir.absolutePath() % "/" % f; + const QString fullPath = dir.absolutePath() + "/" + f; const QString suffix = QFileInfo(fullPath).suffix().toLower(); if(PQCImageHandler::get().getEnabledSuffixes().contains(suffix)) { diff --git a/cplusplus/singletons/scripts/pqc_scriptslocalization.cpp b/cplusplus/singletons/scripts/pqc_scriptslocalization.cpp index 70c3b67d2..6ec0e4c93 100644 --- a/cplusplus/singletons/scripts/pqc_scriptslocalization.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptslocalization.cpp @@ -98,7 +98,7 @@ void PQCScriptsLocalization::updateTranslation(QString code) { for(const QString &c : allcodes) { // the load() function will try various filename combinations - if(trans.load(":/lang/photoqt_" % c % ".qm")) { + if(trans.load(":/lang/photoqt_" + c + ".qm")) { currentTranslation = c; qApp->installTranslator(&trans); break; diff --git a/cplusplus/singletons/scripts/pqc_scriptsmetadata.cpp b/cplusplus/singletons/scripts/pqc_scriptsmetadata.cpp index 6be7e8800..4c89fc11b 100644 --- a/cplusplus/singletons/scripts/pqc_scriptsmetadata.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptsmetadata.cpp @@ -53,7 +53,7 @@ QString PQCScriptsMetaData::analyzeDateTimeOriginal(const QString dateTime, cons const QString inputFormat = (offset.isEmpty() ? "yyyy:MM:dd HH:mm:ss" : "yyyy:MM:dd HH:mm:ssttt"); - const QString combined = dateTime % offset; + const QString combined = dateTime + offset; QDateTime dt = locale.toDateTime(combined, inputFormat); if(dt.isValid()) { @@ -97,7 +97,7 @@ QString PQCScriptsMetaData::analyzeExposureTime(const QString val) { // normalize parts using gcd const int gcd = std::gcd(t1, t2); - return QString::number(t1/gcd) % "/" % QString::number(t2/gcd); + return QString::number(t1/gcd) + "/" + QString::number(t2/gcd); } @@ -143,44 +143,44 @@ QString PQCScriptsMetaData::analyzeFlash(const QString val) { case 6: return fYesStrobe; case 9: - return fYes % " (" % fComp % ")"; + return fYes + " (" + fComp + ")"; case 13: - return fYes % " (" % fComp % ", " % fNoReturn % ")"; + return fYes + " (" + fComp + ", " + fNoReturn + ")"; case 15: - return fYes % " (" % fComp % ", " % fYesReturn % ")"; + return fYes + " (" + fComp + ", " + fYesReturn + ")"; case 16: - return fNo % " (" % fComp % ")"; + return fNo + " (" + fComp + ")"; case 24: - return fNo % " (" % fAuto % ")"; + return fNo + " (" + fAuto + ")"; case 25: - return fYes % " (" % fAuto % ")"; + return fYes + " (" + fAuto + ")"; case 29: - return fYes % " (" % fAuto % ", " % fNoReturn % ")"; + return fYes + " (" + fAuto + ", " + fNoReturn + ")"; case 31: - return fYes % " (" % fAuto % ", " % fYesReturn % ")"; + return fYes + " (" + fAuto + ", " + fYesReturn + ")"; case 32: return fNoFlash; case 65: - return fYes % " (" % fRed % ")"; + return fYes + " (" + fRed + ")"; case 69: - return fYes % " (" % fRed % ", " % fNoReturn % ")"; + return fYes + " (" + fRed + ", " + fNoReturn + ")"; case 71: - return fYes % " (" % fRed % ", " % fYesReturn % ")"; + return fYes + " (" + fRed + ", " + fYesReturn + ")"; case 73: - return fYes % " (" % fComp % ", " % fRed % ")"; + return fYes + " (" + fComp + ", " + fRed + ")"; case 77: - return fYes % " (" % fComp % ", " % fRed % ", " % fNoReturn % ")"; + return fYes + " (" + fComp + ", " + fRed + ", " + fNoReturn + ")"; case 79: - return fYes % " (" % fComp % ", " % fRed % ", " % fYesReturn % ")"; + return fYes + " (" + fComp + ", " + fRed + ", " + fYesReturn + ")"; case 89: - return fYes % " (" % fAuto % ", " % fRed % ")"; + return fYes + " (" + fAuto + ", " + fRed + ")"; case 93: - return fYes % " (" % fAuto % ", " % fNoReturn % ", " % fRed % ")"; + return fYes + " (" + fAuto + ", " + fNoReturn + ", " + fRed + ")"; case 95: - return fYes % " (" % fAuto % ", " % fYesReturn % ", " % fRed % ")"; + return fYes + " (" + fAuto + ", " + fYesReturn + ", " + fRed + ")"; default: //: This string refers to a flash mode, stored in image metadata - return tr("Invalid flash") % " " % val; + return tr("Invalid flash") + " " + val; } } @@ -203,7 +203,7 @@ QString PQCScriptsMetaData::analyzeSceneCaptureType(const QString val) { return tr("Night Scene"); else //: This string refers to a type of scene, stored in image metadata - return tr("Invalid Scene Type") % " " % val; + return tr("Invalid Scene Type") + " " + val; } @@ -285,25 +285,25 @@ QString PQCScriptsMetaData::analyzeLightSource(const QString val) { return tr("Shade"); case 12: //: This string refers to the light source stored in image metadata - return tr("Daylight fluorescent") % " (D 5700 - 7100K)"; + return tr("Daylight fluorescent") + " (D 5700 - 7100K)"; case 13: //: This string refers to the light source stored in image metadata - return tr("Day white fluorescent") % " (N 4600 - 5400K)"; + return tr("Day white fluorescent") + " (N 4600 - 5400K)"; case 14: //: This string refers to the light source stored in image metadata - return tr("Cool white fluorescent") % " (W 3900 - 4500K)"; + return tr("Cool white fluorescent") + " (W 3900 - 4500K)"; case 15: //: This string refers to the light source stored in image metadata - return tr("White fluorescent") % " (WW 3200 - 3700K)"; + return tr("White fluorescent") + " (WW 3200 - 3700K)"; case 17: //: This string refers to the light source stored in image metadata - return tr("Standard light") % " A"; + return tr("Standard light") + " A"; case 18: //: This string refers to the light source stored in image metadata - return tr("Standard light") % " B"; + return tr("Standard light") + " B"; case 19: //: This string refers to the light source stored in image metadata - return tr("Standard light") % " C"; + return tr("Standard light") + " C"; case 20: return "D55"; case 21: @@ -319,7 +319,7 @@ QString PQCScriptsMetaData::analyzeLightSource(const QString val) { return tr("Other light source"); default: //: This string refers to the light source stored in image metadata - return tr("Invalid light source") % " " % val; + return tr("Invalid light source") + " " + val; } } @@ -334,7 +334,7 @@ QString PQCScriptsMetaData::analyzeGPS(QString latRef, QString lat, QString lonR if(latRef.isEmpty()) latRef = "N"; if(lonRef.isEmpty()) lonRef = "E"; - return _analyzeGPSHelper(lat) % " " % latRef % ", " % _analyzeGPSHelper(lon) % " " % lonRef; + return _analyzeGPSHelper(lat) + " " + latRef + ", " + _analyzeGPSHelper(lon) + " " + lonRef; } @@ -374,11 +374,11 @@ QString PQCScriptsMetaData::_analyzeGPSHelper(QString pos) { split.replace(2, QString::number(split.at(2).toDouble()+calcSecs*60)); if(split.length() == 3) - return split.at(0) % "°" % split.at(1) % "'" % split.at(2) % "\""; + return split.at(0) + "°" + split.at(1) + "'" + split.at(2) + "\""; else if(split.length() == 2) - return split.at(0) % "°" % split.at(1) % "'0\""; + return split.at(0) + "°" + split.at(1) + "'0\""; else if(split.length() == 1) - return split.at(0) % "°0'0\""; + return split.at(0) + "°0'0\""; return pos; @@ -452,7 +452,7 @@ QString PQCScriptsMetaData::convertGPSToDecimalForOpenStreetMap(QString gps) { if(pt.x() == 9999) return ""; - return QString::number(pt.x()) % "/" % QString::number(pt.y()); + return QString::number(pt.x()) + "/" + QString::number(pt.y()); } diff --git a/cplusplus/singletons/scripts/pqc_scriptsother.cpp b/cplusplus/singletons/scripts/pqc_scriptsother.cpp index ae5c8934b..ae91b8517 100644 --- a/cplusplus/singletons/scripts/pqc_scriptsother.cpp +++ b/cplusplus/singletons/scripts/pqc_scriptsother.cpp @@ -49,7 +49,7 @@ void PQCScriptsOther::deleteScreenshots() { qDebug() << ""; int count = 0; while(true) { - QFile file(QDir::tempPath() % "/photoqt_screenshot_" % QString::number(count) % ".jpg"); + QFile file(QDir::tempPath() + "/photoqt_screenshot_" + QString::number(count) + ".jpg"); if(file.exists()) file.remove(); else @@ -80,7 +80,7 @@ void PQCScriptsOther::printFile(QString filename) { // get the starting output filename (directory stored, filename based on image filename) QFileInfo info(filename); - printer.setOutputFileName(info.absolutePath() % "/" % info.baseName()); + printer.setOutputFileName(info.absolutePath() + "/" + info.baseName()); // the additional image options tab PQCPrintTabImageOptions *imageoptions = new PQCPrintTabImageOptions(printer.pageLayout().pageSize().rect(QPageSize::Millimeter).size());