Remove kdelibs4 migration code when using Qt6

Upgrading 4->6 is not supported by KF6
This commit is contained in:
Nicolas Fella 2023-09-11 16:57:22 +02:00 committed by Albert Astals Cid
parent e41f682b3d
commit 4addfcc4ec
2 changed files with 9 additions and 0 deletions

View file

@ -61,7 +61,9 @@
#include <KProcess>
#include <KRun>
#include <KShell>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4Migration>
#endif
#include <kio_version.h>
#include <kzip.h>
@ -2288,6 +2290,8 @@ QString DocumentPrivate::docDataFileName(const QUrl &url, qint64 document_size)
QDir().mkpath(docdataDir);
}
QString newokularfile = docdataDir + QLatin1Char('/') + fn;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// we don't want to accidentally migrate old files when running unit tests
if (!QFile::exists(newokularfile) && !QStandardPaths::isTestModeEnabled()) {
// see if an KDE4 file still exists
@ -2303,6 +2307,7 @@ QString DocumentPrivate::docDataFileName(const QUrl &url, qint64 document_size)
}
}
}
#endif
return newokularfile;
}

View file

@ -74,8 +74,10 @@
#include <KToggleAction>
#include <KToggleFullScreenAction>
#include <KToolBar>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
#include <Kdelibs4Migration>
#endif
#if HAVE_KWALLET
#include <KWallet>
#endif
@ -623,6 +625,7 @@ void Part::setupConfigSkeleton(const QVariantList &args, const QString &componen
configFilePath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + configFileName;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Migrate old config
if (!QFile::exists(configFilePath)) {
qCDebug(OkularUiDebug) << "Did not find a config file, attempting to look for old config";
@ -655,6 +658,7 @@ void Part::setupConfigSkeleton(const QVariantList &args, const QString &componen
qCDebug(OkularUiDebug) << "Migrated old okular config";
}
}
#endif
KSharedConfigPtr config = KSharedConfig::openConfig(configFilePath);