Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Drop code variant for no longer supported Qt variant

parent 55ab3bb8
......@@ -43,18 +43,6 @@
#include <libkomparediff2/diffsettings.h>
QUrl urlFromArg(const QString& arg)
{
#if QT_VERSION >= 0x050400
return QUrl::fromUserInput(arg, QDir::currentPath(), QUrl::AssumeLocalFile);
#else
// Logic from QUrl::fromUserInput(QString, QString, UserInputResolutionOptions)
return (QUrl(arg, QUrl::TolerantMode).isRelative() && !QDir::isAbsolutePath(arg))
? QUrl::fromLocalFile(QDir::current().absoluteFilePath(arg))
: QUrl::fromUserInput(arg);
#endif
}
DiffPage::DiffPage() : QFrame(), m_ignoreRegExpDialog(nullptr)
{
QVBoxLayout* layout = new QVBoxLayout(this);
......@@ -106,7 +94,7 @@ void DiffPage::setSettings(DiffSettings* setts)
m_excludeFileNameGroupBox->setChecked(m_settings->m_excludeFilesFile);
slotExcludeFileToggled(m_settings->m_excludeFilesFile);
m_excludeFileURLComboBox->setUrls(m_settings->m_excludeFilesFileHistoryList);
m_excludeFileURLComboBox->setUrl(urlFromArg(m_settings->m_excludeFilesFileURL));
m_excludeFileURLComboBox->setUrl(QUrl::fromUserInput(m_settings->m_excludeFilesFileURL, QDir::currentPath(), QUrl::AssumeLocalFile));
}
DiffSettings* DiffPage::settings()
......
......@@ -30,8 +30,6 @@
#include "filessettings.h"
QUrl urlFromArg(const QString& arg);
FilesPage::FilesPage() : QFrame()
{
QVBoxLayout* layout = new QVBoxLayout(this);
......@@ -178,8 +176,8 @@ void FilesPage::setURLsInComboBoxes()
{
// qDebug() << "first : " << m_firstURLComboBox->currentText() ;
// qDebug() << "second: " << m_secondURLComboBox->currentText() ;
m_firstURLComboBox->setUrl(urlFromArg(m_firstURLComboBox->currentText()));
m_secondURLComboBox->setUrl(urlFromArg(m_secondURLComboBox->currentText()));
m_firstURLComboBox->setUrl(QUrl::fromUserInput(m_firstURLComboBox->currentText(), QDir::currentPath(), QUrl::AssumeLocalFile));
m_secondURLComboBox->setUrl(QUrl::fromUserInput(m_secondURLComboBox->currentText(), QDir::currentPath(), QUrl::AssumeLocalFile));
}
......@@ -208,9 +206,9 @@ void FilesPage::setSettings(FilesSettings* settings)
m_settings = settings;
m_firstURLComboBox->setUrls(m_settings->m_recentSources);
m_firstURLComboBox->setUrl(urlFromArg(m_settings->m_lastChosenSourceURL));
m_firstURLComboBox->setUrl(QUrl::fromUserInput(m_settings->m_lastChosenSourceURL, QDir::currentPath(), QUrl::AssumeLocalFile));
m_secondURLComboBox->setUrls(m_settings->m_recentDestinations);
m_secondURLComboBox->setUrl(urlFromArg(m_settings->m_lastChosenDestinationURL));
m_secondURLComboBox->setUrl(QUrl::fromUserInput(m_settings->m_lastChosenDestinationURL, QDir::currentPath(), QUrl::AssumeLocalFile));
m_encodingComboBox->setCurrentIndex(m_encodingComboBox->findText(m_settings->m_encoding, Qt::MatchFixedString));
}
......
......@@ -40,18 +40,6 @@
#include "kompare_shell.h"
#include "kompareurldialog.h"
QUrl urlFromArg(const QString& arg)
{
#if QT_VERSION >= 0x050400
return QUrl::fromUserInput(arg, QDir::currentPath(), QUrl::AssumeLocalFile);
#else
// Logic from QUrl::fromUserInput(QString, QString, UserInputResolutionOptions)
return (QUrl(arg, QUrl::TolerantMode).isRelative() && !QDir::isAbsolutePath(arg))
? QUrl::fromLocalFile(QDir::current().absoluteFilePath(arg))
: QUrl::fromUserInput(arg);
#endif
}
/**
* Setting up the KAboutData structure.
* Parsing and handling of the given command line arguments.
......@@ -133,7 +121,7 @@ int main(int argc, char* argv[])
if (args.at(0) == QLatin1String("-"))
ks->openStdin();
else
ks->openDiff(urlFromArg(args.at(0)));
ks->openDiff(QUrl::fromUserInput(args.at(0), QDir::currentPath(), QUrl::AssumeLocalFile));
difault = false;
}
}
......@@ -148,9 +136,9 @@ int main(int argc, char* argv[])
else
{
ks->show();
QUrl url0 = urlFromArg(args.at(0));
QUrl url0 = QUrl::fromUserInput(args.at(0), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
QUrl url1 = urlFromArg(args.at(1));
QUrl url1 = QUrl::fromUserInput(args.at(1), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
ks->compare(url0, url1);
difault = false;
......@@ -168,9 +156,9 @@ int main(int argc, char* argv[])
{
ks->show();
qCDebug(KOMPARESHELL) << "blend..." ;
QUrl url0 = urlFromArg(args.at(0));
QUrl url0 = QUrl::fromUserInput(args.at(0), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
QUrl url1 = urlFromArg(args.at(1));
QUrl url1 = QUrl::fromUserInput(args.at(1), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
ks->blend(url0, url1);
difault = false;
......@@ -184,7 +172,7 @@ int main(int argc, char* argv[])
if (args.at(0) == QLatin1String("-"))
ks->openStdin();
else
ks->openDiff(urlFromArg(args.at(0)));
ks->openDiff(QUrl::fromUserInput(args.at(0), QDir::currentPath(), QUrl::AssumeLocalFile));
difault = false;
}
......@@ -194,9 +182,9 @@ int main(int argc, char* argv[])
// and not blending because that is almost impossible to detect
ks->show();
qCDebug(KOMPARESHELL) << "Dunno, we'll have to figure it out later, trying compare for now..." ;
QUrl url0 = urlFromArg(args.at(0));
QUrl url0 = QUrl::fromUserInput(args.at(0), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
QUrl url1 = urlFromArg(args.at(1));
QUrl url1 = QUrl::fromUserInput(args.at(1), QDir::currentPath(), QUrl::AssumeLocalFile);
qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
ks->compare(url0, url1);
difault = false;
......
Markdown is supported
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