Commit 9206eaf0 authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix qt6 support

parent 101e6433
Pipeline #247892 passed with stage
in 3 minutes and 57 seconds
......@@ -92,8 +92,8 @@ KZip *AbstractImportExportJob::archive() const
void AbstractImportExportJob::backupUiRcFile(const QString &configFileName, const QString &application)
{
const QString configrcStr(configFileName);
const QString configrc =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + application + QLatin1Char('/') + configrcStr;
const QString configrc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("kxmlgui" QT_STRINGIFY(QT_VERSION_MAJOR))
+ application + QLatin1Char('/') + configrcStr;
if (QFileInfo::exists(configrc)) {
backupFile(configrc, Utils::configsPath(), configrcStr);
}
......@@ -455,8 +455,8 @@ void AbstractImportExportJob::restoreUiRcFile(const QString &configNameStr, cons
const KArchiveEntry *configNameentry = mArchiveDirectory->entry(Utils::configsPath() + configNameStr);
if (configNameentry && configNameentry->isFile()) {
const auto configNameconfiguration = static_cast<const KArchiveFile *>(configNameentry);
const QString configNamerc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + applicationName
+ QLatin1Char('/') + configNameStr;
const QString configNamerc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QStringLiteral("kxmlgui" QT_STRINGIFY(QT_VERSION_MAJOR)) + applicationName + QLatin1Char('/') + configNameStr;
if (QFileInfo::exists(configNamerc)) {
if (overwriteConfigMessageBox(configNameStr)) {
copyToFile(configNameconfiguration, configNamerc, configNameStr, Utils::configsPath());
......
......@@ -32,22 +32,23 @@ void CompareImportFile::compareFile()
if (file == QLatin1String("information/exportdatatype.xml") || file == QLatin1String("information/VERSION_2")) {
continue;
}
file.replace(QStringLiteral("config/kleopatra.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kleopatra/kleopatra.rc"));
file.replace(QStringLiteral("config/akonadiconsoleui.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("akonadiconsole/akonadiconsoleui.rc"));
file.replace(QStringLiteral("config/kmail_part.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kmail2/kmail_part.rc"));
file.replace(QStringLiteral("config/kmcomposerui.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kmail2/kmcomposerui.rc"));
file.replace(QStringLiteral("config/kmmainwin.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kmail2/kmmainwin.rc"));
file.replace(QStringLiteral("config/kmreadermainwin.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kmail2/kmmainwin.rc"));
file.replace(QStringLiteral("config/kontactsummary_part.rc"),
QStringLiteral("share/kxmlgui5/") + QStringLiteral("kontactsummary/kontactsummary_part.rc"));
file.replace(QStringLiteral("config/kwatchgnupgui.rc"), QStringLiteral("share/kxmlgui5/") + QStringLiteral("kwatchgnupg/kwatchgnupgui.rc"));
// TODO verify with qt6 path
const QString kxmguiPath{QStringLiteral("share/kxmlgui5/")};
file.replace(QStringLiteral("config/kleopatra.rc"), kxmguiPath + QStringLiteral("kleopatra/kleopatra.rc"));
file.replace(QStringLiteral("config/akonadiconsoleui.rc"), kxmguiPath + QStringLiteral("akonadiconsole/akonadiconsoleui.rc"));
file.replace(QStringLiteral("config/kmail_part.rc"), kxmguiPath + QStringLiteral("kmail2/kmail_part.rc"));
file.replace(QStringLiteral("config/kmcomposerui.rc"), kxmguiPath + QStringLiteral("kmail2/kmcomposerui.rc"));
file.replace(QStringLiteral("config/kmmainwin.rc"), kxmguiPath + QStringLiteral("kmail2/kmmainwin.rc"));
file.replace(QStringLiteral("config/kmreadermainwin.rc"), kxmguiPath + QStringLiteral("kmail2/kmmainwin.rc"));
file.replace(QStringLiteral("config/kontactsummary_part.rc"), kxmguiPath + QStringLiteral("kontactsummary/kontactsummary_part.rc"));
file.replace(QStringLiteral("config/kwatchgnupgui.rc"), kxmguiPath + QStringLiteral("kwatchgnupg/kwatchgnupgui.rc"));
if (file.endsWith(QLatin1String("ui.rc")) && !file.contains(QStringLiteral("kmcomposerui.rc")) && !file.contains(QStringLiteral("akonadiconsoleui.rc"))
&& !file.contains(QStringLiteral("kwatchgnupgui.rc"))) {
QString fileName = file;
fileName.remove(QStringLiteral("config/"));
const QString fileuirc = fileName;
fileName.remove(QStringLiteral("ui.rc"));
file = QStringLiteral("share/kxmlgui5/") + fileName + QLatin1Char('/') + fileuirc;
file = kxmguiPath + fileName + QLatin1Char('/') + fileuirc;
}
// file.replace(QStringLiteral("identities/"), QStringLiteral("config/"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment