summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-05 14:00:45 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-05 14:00:45 (GMT)
commit76e83d3be2a3bbe4c7c26f2aecb8c8448866eae5 (patch)
treeed052c90a2c0665770f790fdf9e745fac733c86c
parentbb34b3d4ee6a64a35078bb965917c91343711d3d (diff)
Port away from KUrl to QUrl.
-rw-r--r--CMakeLists.txt5
-rw-r--r--editor/kgpgeditor.cpp41
-rw-r--r--editor/kgpgeditor.h12
-rw-r--r--editor/kgpgmd5widget.cpp2
-rw-r--r--editor/kgpgmd5widget.h4
-rw-r--r--editor/kgpgtextedit.cpp15
-rw-r--r--editor/kgpgtextedit.h6
-rw-r--r--foldercompressjob.cpp14
-rw-r--r--foldercompressjob.h4
-rw-r--r--keysmanager.cpp28
-rw-r--r--keysmanager.h4
-rw-r--r--keytreeview.cpp6
-rw-r--r--keytreeview.h4
-rw-r--r--kgpg.cpp6
-rw-r--r--kgpgexternalactions.cpp32
-rw-r--r--kgpgexternalactions.h20
-rw-r--r--kgpgfirstassistant.cpp6
-rw-r--r--kgpgoptions.cpp18
-rw-r--r--kgpgrevokewidget.cpp8
-rw-r--r--kgpgrevokewidget.h4
-rw-r--r--kgpgtextinterface.cpp4
-rw-r--r--kgpgtextinterface.h5
-rw-r--r--selectpublickeydialog.cpp4
-rw-r--r--selectpublickeydialog.h8
-rw-r--r--transactions/kgpgdecrypt.cpp8
-rw-r--r--transactions/kgpgdecrypt.h6
-rw-r--r--transactions/kgpgencrypt.cpp10
-rw-r--r--transactions/kgpgencrypt.h6
-rw-r--r--transactions/kgpggeneraterevoke.cpp4
-rw-r--r--transactions/kgpggeneraterevoke.h8
-rw-r--r--transactions/kgpgimport.cpp2
-rw-r--r--transactions/kgpgimport.h4
-rw-r--r--transactions/kgpgsigntext.cpp4
-rw-r--r--transactions/kgpgsigntext.h4
-rw-r--r--transactions/kgpgtextorfiletransaction.cpp8
-rw-r--r--transactions/kgpgtextorfiletransaction.h10
-rw-r--r--transactions/kgpgtransaction.cpp4
-rw-r--r--transactions/kgpgtransaction.h4
-rw-r--r--transactions/kgpgtransactionprivate.h4
-rw-r--r--transactions/kgpgverify.cpp2
-rw-r--r--transactions/kgpgverify.h4
41 files changed, 183 insertions, 169 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0271995..e3f26fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,8 @@ find_package(KF5 REQUIRED
I18n
IconThemes
Codecs
+ Contacts
+ CoreAddons
KIO
KDELibs4Support
Service
@@ -38,6 +40,8 @@ find_package(KF5 REQUIRED
# only headers are used
find_package(Gpgme REQUIRED)
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
+
add_subdirectory( icons )
add_subdirectory( doc )
include_directories( ${KDEPIMLIBS_INCLUDE_DIR} ${GPGME_INCLUDES} )
@@ -219,6 +223,7 @@ target_link_libraries(kgpg
KF5::Archive
KF5::Codecs
KF5::Contacts
+ KF5::CoreAddons
KF5::KDELibs4Support
KF5::KIOCore
KF5::AkonadiContact
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index a1ed889..8736452 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -42,6 +42,7 @@
#include <KStandardAction>
#include <KToggleAction>
#include <KToolBar>
+#include <KUrlRequester>
#include <QAction>
#include <QIcon>
@@ -112,7 +113,7 @@ KgpgEditor::~KgpgEditor()
m_recentfiles->saveEntries( KConfigGroup(KSharedConfig::openConfig(), "Recent Files" ) );
}
-void KgpgEditor::openDocumentFile(const KUrl& url, const QString &encoding)
+void KgpgEditor::openDocumentFile(const QUrl &url, const QString &encoding)
{
QString tempopenfile;
if(KIO::NetAccess::download(url, tempopenfile, this))
@@ -134,7 +135,7 @@ void KgpgEditor::openDocumentFile(const KUrl& url, const QString &encoding)
}
}
-void KgpgEditor::openEncryptedDocumentFile(const KUrl& url)
+void KgpgEditor::openEncryptedDocumentFile(const QUrl &url)
{
m_editor->slotDroppedFile(url);
}
@@ -177,7 +178,7 @@ void KgpgEditor::initActions()
m_editcopy = KStandardAction::copy(this, SLOT(slotEditCopy()), actionCollection());
m_editcut = KStandardAction::cut(this, SLOT(slotEditCut()), actionCollection());
- m_recentfiles = KStandardAction::openRecent(this, SLOT(openDocumentFile(KUrl)), this);
+ m_recentfiles = KStandardAction::openRecent(this, SLOT(openDocumentFile(QUrl)), this);
menuBar()->addAction(m_recentfiles);
m_recentfiles->loadEntries( KConfigGroup(KSharedConfig::openConfig(), "Recent Files" ) );
@@ -272,8 +273,8 @@ void KgpgEditor::slotFileOpen()
if (saveBeforeClear())
{
KEncodingFileDialog::Result loadResult;
- loadResult = KEncodingFileDialog::getOpenUrlAndEncoding(QString(), QString(), QString(), this);
- KUrl url = loadResult.URLs.first();
+ loadResult = KEncodingFileDialog::getOpenUrlAndEncoding(QString(), QUrl(), QString(), this);
+ QUrl url = loadResult.URLs.first();
m_textencoding = loadResult.encoding;
if(!url.isEmpty())
@@ -338,8 +339,8 @@ bool KgpgEditor::slotFileSave()
bool KgpgEditor::slotFileSaveAs()
{
KEncodingFileDialog::Result saveResult;
- saveResult = KEncodingFileDialog::getSaveUrlAndEncoding(QString(), QString(), QString(), this);
- KUrl url;
+ saveResult = KEncodingFileDialog::getSaveUrlAndEncoding(QString(), QUrl(), QString(), this);
+ QUrl url;
if (!saveResult.URLs.empty())
url = saveResult.URLs.first();
@@ -468,7 +469,7 @@ void KgpgEditor::slotFindText()
void KgpgEditor::slotFilePreEnc()
{
- KUrl::List urls = KFileDialog::getOpenUrls(KUrl(), i18n("*|All Files"), this, i18n("Open File to Encode"));
+ QList<QUrl> urls = KFileDialog::getOpenUrls(QUrl(), i18n("*|All Files"), this, i18n("Open File to Encode"));
if (urls.isEmpty())
return;
@@ -477,7 +478,7 @@ void KgpgEditor::slotFilePreEnc()
void KgpgEditor::slotFilePreDec()
{
- KUrl url = KFileDialog::getOpenUrl(KUrl(), i18n("*|All Files"), this, i18n("Open File to Decode"));
+ QUrl url = KFileDialog::getOpenUrl(QUrl(), i18n("*|All Files"), this, i18n("Open File to Decode"));
if (url.isEmpty())
return;
@@ -488,7 +489,7 @@ void KgpgEditor::slotFilePreDec()
oldname.chop(4);
else
oldname.append(QLatin1String( ".clear" ));
- oldname.prepend(url.directory(KUrl::AppendTrailingSlash));
+ oldname.prepend(url.adjusted(QUrl::RemoveFilename).path());
QPointer<KDialog> popn = new KDialog(this);
popn->setWindowTitle(i18n("Decrypt File To"));
@@ -498,7 +499,7 @@ void KgpgEditor::slotFilePreDec()
SrcSelect *page = new SrcSelect();
popn->setMainWidget(page);
- page->newFilename->setUrl(oldname);
+ page->newFilename->setUrl(QUrl(oldname));
page->newFilename->setMode(KFile::File);
page->newFilename->setWindowTitle(i18n("Save File"));
@@ -531,7 +532,7 @@ void KgpgEditor::slotFilePreDec()
delete over;
}
- KGpgDecrypt *decr = new KGpgDecrypt(this, url, KUrl(newname));
+ KGpgDecrypt *decr = new KGpgDecrypt(this, url, QUrl(newname));
connect(decr, SIGNAL(done(int)), SLOT(slotLibraryDone()));
decr->start();
}
@@ -612,12 +613,12 @@ void KgpgEditor::slotResetEncoding(bool enc)
void KgpgEditor::slotPreSignFile()
{
// create a detached signature for a chosen file
- KUrl url = KFileDialog::getOpenUrl(KUrl(), i18n("*|All Files"), this, i18n("Open File to Sign"));
+ QUrl url = KFileDialog::getOpenUrl(QUrl(), i18n("*|All Files"), this, i18n("Open File to Sign"));
if (!url.isEmpty())
slotSignFile(url);
}
-void KgpgEditor::slotSignFile(const KUrl &url)
+void KgpgEditor::slotSignFile(const QUrl &url)
{
// create a detached signature for a chosen file
if (!url.isEmpty())
@@ -637,7 +638,7 @@ void KgpgEditor::slotSignFile(const KUrl &url)
if (KGpgSettings::asciiArmor())
sopts |= KGpgSignText::AsciiArmored;
- KGpgSignText *signt = new KGpgSignText(this, signKeyID, KUrl::List(url), sopts);
+ KGpgSignText *signt = new KGpgSignText(this, signKeyID, QList<QUrl>({url}), sopts);
connect(signt, SIGNAL(done(int)), SLOT(slotSignFileFin()));
signt->start();
}
@@ -650,11 +651,11 @@ void KgpgEditor::slotSignFileFin()
void KgpgEditor::slotPreVerifyFile()
{
- KUrl url = KFileDialog::getOpenUrl(KUrl(), i18n("*|All Files"), this, i18n("Open File to Verify"));
+ QUrl url = KFileDialog::getOpenUrl(QUrl(), i18n("*|All Files"), this, i18n("Open File to Verify"));
slotVerifyFile(url);
}
-void KgpgEditor::slotVerifyFile(const KUrl &url)
+void KgpgEditor::slotVerifyFile(const QUrl &url)
{
if (!url.isEmpty())
{
@@ -673,11 +674,11 @@ void KgpgEditor::slotVerifyFile(const KUrl &url)
}
}
- KUrl::List chkfiles;
+ QList<QUrl> chkfiles;
if (sigfile.isEmpty())
chkfiles << url;
else
- chkfiles << KUrl::fromPath(sigfile);
+ chkfiles << QUrl::fromLocalFile(sigfile);
KGpgVerify *verify = new KGpgVerify(this, chkfiles);
connect(verify, SIGNAL(done(int)), m_editor, SLOT(slotVerifyDone(int)));
@@ -688,7 +689,7 @@ void KgpgEditor::slotVerifyFile(const KUrl &url)
void KgpgEditor::slotCheckMd5()
{
// display md5 sum for a chosen file
- KUrl url = KFileDialog::getOpenUrl(KUrl(), i18n("*|All Files"), this, i18n("Open File to Verify"));
+ QUrl url = KFileDialog::getOpenUrl(QUrl(), i18n("*|All Files"), this, i18n("Open File to Verify"));
if (!url.isEmpty()) {
QPointer<Md5Widget> mdwidget = new Md5Widget(this, url);
mdwidget->exec();
diff --git a/editor/kgpgeditor.h b/editor/kgpgeditor.h
index c359898..97cd4ac 100644
--- a/editor/kgpgeditor.h
+++ b/editor/kgpgeditor.h
@@ -19,7 +19,7 @@
#define KGPGEDITOR_H
#include <KXmlGuiWindow>
-#include <KUrl>
+#include <QUrl>
#include <kgpgcompiler.h>
@@ -42,7 +42,7 @@ public:
KgpgEditor(KeysManager *parent, KGpgItemModel *model, Qt::WFlags f);
~KgpgEditor();
- void openEncryptedDocumentFile(const KUrl& url);
+ void openEncryptedDocumentFile(const QUrl &url);
KgpgTextEdit * const m_editor;
KRecentFilesAction *m_recentfiles;
@@ -52,7 +52,7 @@ signals:
void openConfigDialog();
public slots:
- void openDocumentFile(const KUrl& url, const QString &encoding = QString());
+ void openDocumentFile(const QUrl &url, const QString &encoding = QString());
void slotSetFont(QFont myFont);
void closeWindow();
@@ -93,10 +93,10 @@ private slots:
// Signing menu
void slotPreSignFile();
- void slotSignFile(const KUrl &url);
+ void slotSignFile(const QUrl &url);
void slotSignFileFin();
void slotPreVerifyFile();
- void slotVerifyFile(const KUrl &url);
+ void slotVerifyFile(const QUrl &url);
void slotCheckMd5();
void importSignatureKey(const QString &id, const QString &fileName);
@@ -123,7 +123,7 @@ private:
QAction *m_editcopy;
QAction *m_editcut;
KFind *m_find;
- KUrl m_docname;
+ QUrl m_docname;
bool m_textchanged; //< text was changed since last save
bool m_emptytext; //< this was not saved to a file ever
diff --git a/editor/kgpgmd5widget.cpp b/editor/kgpgmd5widget.cpp
index b1c099e..2805849 100644
--- a/editor/kgpgmd5widget.cpp
+++ b/editor/kgpgmd5widget.cpp
@@ -22,7 +22,7 @@
#include <KLed>
-Md5Widget::Md5Widget(QWidget *parent, const KUrl &url)
+Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
: KDialog(parent)
{
setWindowTitle(i18n("MD5 Checksum"));
diff --git a/editor/kgpgmd5widget.h b/editor/kgpgmd5widget.h
index 0de227a..11ffcdf 100644
--- a/editor/kgpgmd5widget.h
+++ b/editor/kgpgmd5widget.h
@@ -11,7 +11,7 @@
#define KGPGMD5WIDGET_H
#include <KDialog>
-#include <KUrl>
+#include <QUrl>
#include <kgpgcompiler.h>
@@ -24,7 +24,7 @@ class Md5Widget : public KDialog
Q_OBJECT
public:
- explicit Md5Widget(QWidget *parent = Q_NULLPTR, const KUrl &url = KUrl());
+ explicit Md5Widget(QWidget *parent = Q_NULLPTR, const QUrl &url = QUrl());
public slots:
void slotApply();
diff --git a/editor/kgpgtextedit.cpp b/editor/kgpgtextedit.cpp
index 9ae94f4..8bb9a17 100644
--- a/editor/kgpgtextedit.cpp
+++ b/editor/kgpgtextedit.cpp
@@ -29,6 +29,7 @@
#include <KLocale>
#include <KMessageBox>
+#include <KUrlMimeData>
#include <QDragEnterEvent>
#include <QDropEvent>
@@ -61,14 +62,14 @@ KgpgTextEdit::~KgpgTextEdit()
void KgpgTextEdit::dragEnterEvent(QDragEnterEvent *e)
{
// if a file is dragged into editor ...
- if (KUrl::List::canDecode(e->mimeData()) || e->mimeData()->hasText())
+ if (e->mimeData()->hasUrls() || e->mimeData()->hasText())
e->acceptProposedAction();
}
void KgpgTextEdit::dropEvent(QDropEvent *e)
{
// decode dropped file or dropped text
- KUrl::List uriList = KUrl::List::fromMimeData(e->mimeData());
+ QList<QUrl> uriList = KUrlMimeData::urlsFromMimeData(e->mimeData());
if (!uriList.isEmpty())
slotDroppedFile(uriList.first());
else
@@ -76,14 +77,14 @@ void KgpgTextEdit::dropEvent(QDropEvent *e)
insertPlainText(e->mimeData()->text());
}
-void KgpgTextEdit::slotDroppedFile(const KUrl &url)
+void KgpgTextEdit::slotDroppedFile(const QUrl &url)
{
openDroppedFile(url, true);
}
-void KgpgTextEdit::openDroppedFile(const KUrl& url, const bool probe)
+void KgpgTextEdit::openDroppedFile(const QUrl &url, const bool probe)
{
- KUrl tmpurl;
+ QUrl tmpurl;
if (url.isLocalFile()) {
m_tempfile = url.path();
@@ -96,7 +97,7 @@ void KgpgTextEdit::openDroppedFile(const KUrl& url, const bool probe)
KMessageBox::sorry(this, i18n("Could not download file."));
return;
}
- tmpurl = KUrl::fromPath(m_tempfile);
+ tmpurl = QUrl::fromLocalFile(m_tempfile);
}
QString result;
@@ -113,7 +114,7 @@ void KgpgTextEdit::openDroppedFile(const KUrl& url, const bool probe)
if (!probe || KGpgDecrypt::isEncryptedText(result, &m_posstart, &m_posend)) {
// if pgp data found, decode it
- KGpgDecrypt *decr = new KGpgDecrypt(this, KUrl::List(tmpurl));
+ KGpgDecrypt *decr = new KGpgDecrypt(this, QList<QUrl>({url}));
connect(decr, SIGNAL(done(int)), SLOT(slotDecryptDone(int)));
decr->start();
return;
diff --git a/editor/kgpgtextedit.h b/editor/kgpgtextedit.h
index afafa3b..26cfed1 100644
--- a/editor/kgpgtextedit.h
+++ b/editor/kgpgtextedit.h
@@ -18,7 +18,7 @@
#include <QString>
#include <KTextEdit>
-#include <KUrl>
+#include <QUrl>
class QDragEnterEvent;
class QDropEvent;
@@ -35,7 +35,7 @@ public:
~KgpgTextEdit();
void signVerifyText(const QString &message);
- void openDroppedFile(const KUrl &url, const bool probe);
+ void openDroppedFile(const QUrl &url, const bool probe);
signals:
void newText();
@@ -43,7 +43,7 @@ signals:
void verifyFinished();
public slots:
- void slotDroppedFile(const KUrl &url);
+ void slotDroppedFile(const QUrl &url);
void slotEncode();
void slotDecode();
void slotSign(const QString &message);
diff --git a/foldercompressjob.cpp b/foldercompressjob.cpp
index abe88b1..77e521c 100644
--- a/foldercompressjob.cpp
+++ b/foldercompressjob.cpp
@@ -28,11 +28,11 @@ class FolderCompressJobPrivate {
Q_DECLARE_PUBLIC(FolderCompressJob)
public:
- FolderCompressJobPrivate(FolderCompressJob *parent, const KUrl::List &sources, const KUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive);
+ FolderCompressJobPrivate(FolderCompressJob *parent, const QList<QUrl> &sources, const QUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive);
const QString m_description;
- const KUrl::List m_sources;
- const KUrl m_dest;
+ const QList<QUrl> m_sources;
+ const QUrl m_dest;
QTemporaryFile * const m_tempfile;
const QStringList m_keys;
QStringList m_options;
@@ -40,7 +40,7 @@ public:
const int m_archiveType;
};
-FolderCompressJobPrivate::FolderCompressJobPrivate(FolderCompressJob *parent, const KUrl::List &sources, const KUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive)
+FolderCompressJobPrivate::FolderCompressJobPrivate(FolderCompressJob *parent, const QList<QUrl> &sources, const QUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive)
: q_ptr(parent),
m_description(i18n("Processing folder compression and encryption")),
m_sources(sources),
@@ -53,7 +53,7 @@ FolderCompressJobPrivate::FolderCompressJobPrivate(FolderCompressJob *parent, co
{
}
-FolderCompressJob::FolderCompressJob(QObject *parent, const KUrl::List &sources, const KUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive)
+FolderCompressJob::FolderCompressJob(QObject *parent, const QList<QUrl> &sources, const QUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive)
: KJob(parent),
d_ptr(new FolderCompressJobPrivate(this, sources, dest, tempfile, keys, options, encOptions, archive))
{
@@ -108,7 +108,7 @@ FolderCompressJob::doWork()
return;
}
- foreach (const KUrl &url, d->m_sources)
+ foreach (const QUrl &url, d->m_sources)
arch->addLocalDirectory(url.path(), url.fileName());
arch->close();
delete arch;
@@ -124,7 +124,7 @@ FolderCompressJob::doWork()
i18nc("Status message 'Encrypting <filename>' (operation starts)", "Encrypting %1", d->m_dest.path())));
- KGpgEncrypt *enc = new KGpgEncrypt(this, d->m_keys, KUrl::List(KUrl::fromPath(d->m_tempfile->fileName())), d->m_encOptions, d->m_options);
+ KGpgEncrypt *enc = new KGpgEncrypt(this, d->m_keys, QList<QUrl>({QUrl::fromLocalFile(d->m_tempfile->fileName())}), d->m_encOptions, d->m_options);
connect(enc, SIGNAL(done(int)), SLOT(slotEncryptionDone(int)));
enc->start();
}
diff --git a/foldercompressjob.h b/foldercompressjob.h
index 6aefb70..8d709de 100644
--- a/foldercompressjob.h
+++ b/foldercompressjob.h
@@ -15,7 +15,7 @@
#define FOLDERCOMPRESSJOB_H
#include <KJob>
-#include <KUrl>
+#include <QUrl>
class QTemporaryFile;
class QString;
@@ -51,7 +51,7 @@ public:
* @param encOptions special options to pass to the GnuPG process
* @param archive the archive type to use
*/
- FolderCompressJob(QObject *parent, const KUrl::List &sources, const KUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive);
+ FolderCompressJob(QObject *parent, const QList<QUrl> &sources, const QUrl &dest, QTemporaryFile *tempfile, const QStringList &keys, const QStringList &options, const KGpgEncrypt::EncryptOptions encOptions, const int archive);
/**
* @brief FolderCompressJob destructor
diff --git a/keysmanager.cpp b/keysmanager.cpp
index 6d6957f..f90e097 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -61,7 +61,6 @@
#include <akonadi/contact/contactsearchjob.h>
#include <KActionCollection>
#include <KDebug>
-#include <KFileDialog>
#include <KInputDialog>
#include <KGlobal>
#include <KLocale>
@@ -80,13 +79,14 @@
#include <KStatusNotifierItem>
#include <KToggleAction>
#include <KToolInvocation>
-#include <KUrl>
+#include <QUrl>
#include <QApplication>
#include <QClipboard>
#include <QDBusConnection>
#include <QDir>
#include <QEvent>
+#include <QFileDialog>
#include <QIcon>
#include <QKeySequence>
#include <QLabel>
@@ -324,7 +324,7 @@ KeysManager::KeysManager(QWidget *parent)
iview = new KeyTreeView(this, iproxy);
connect(iview, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(defaultAction(QModelIndex)));
- connect(iview, SIGNAL(importDrop(KUrl::List)), SLOT(slotImport(KUrl::List)));
+ connect(iview, SIGNAL(importDrop(QList<QUrl>)), SLOT(slotImport(QList<QUrl>)));
iview->setSelectionMode(QAbstractItemView::ExtendedSelection);
setCentralWidget(iview);
iview->resizeColumnsToContents();
@@ -599,14 +599,14 @@ void KeysManager::slotGenerateKeyDone(KJob *job)
QString revurl;
const QString gpgPath(KGpgSettings::gpgConfigPath());
if (!gpgPath.isEmpty())
- revurl = KUrl::fromPath(gpgPath).directory(KUrl::AppendTrailingSlash);
+ revurl = QUrl::fromLocalFile(gpgPath).adjusted(QUrl::RemoveFilename).path();
else
revurl = QDir::homePath() + QLatin1Char( '/' );
if (!email.isEmpty())
- page->kURLRequester1->setUrl(QString(revurl + email.section(QLatin1Char( '@' ), 0, 0) + QLatin1String( ".revoke" )));
+ page->kURLRequester1->setUrl(QUrl(revurl + email.section(QLatin1Char( '@' ), 0, 0) + QLatin1String( ".revoke" )));
else
- page->kURLRequester1->setUrl(QString(revurl + genkey->getName().section(QLatin1Char(' '), 0, 0) + QLatin1String(".revoke")));
+ page->kURLRequester1->setUrl(QUrl(revurl + genkey->getName().section(QLatin1Char(' '), 0, 0) + QLatin1String(".revoke")));
const QString fingerprint(genkey->getFingerprint());
page->TLid->setText(QLatin1String( "<b>" ) + fingerprint.right(8) + QLatin1String( "</b>" ));
@@ -627,7 +627,7 @@ void KeysManager::slotGenerateKeyDone(KJob *job)
iview->selectNode(knode);
if (page->CBsave->isChecked() || page->CBprint->isChecked()) {
- KUrl revurl;
+ QUrl revurl;
if (page->CBsave->isChecked())
revurl = page->kURLRequester1->url();
@@ -923,7 +923,7 @@ void KeysManager::slotAddPhoto()
if (KMessageBox::warningContinueCancel(0, mess) != KMessageBox::Continue)
return;
- QString imagepath = KFileDialog::getOpenFileName(KUrl(), QLatin1String( "image/jpeg" ), 0);
+ QString imagepath = QFileDialog::getOpenFileName(0, QString(), QString(), QLatin1String( "image/jpeg" ));
if (imagepath.isEmpty())
return;
@@ -1379,7 +1379,7 @@ void KeysManager::slotexportsec()
sname = nd->getName().section(QLatin1Char( ' ' ), 0, 0);
sname.append(QLatin1String( ".asc" ));
sname.prepend(QDir::homePath() + QLatin1Char( '/' ));
- KUrl url(KFileDialog::getSaveUrl(sname, i18n( "*.asc|*.asc Files" ), this, i18n("Export PRIVATE KEY As")));
+ QUrl url(QFileDialog::getSaveFileUrl(this, i18n("Export PRIVATE KEY As"), QUrl(sname), i18n( "*.asc|*.asc Files" )));
if(!url.isEmpty()) {
KGpgExport *exp = new KGpgExport(this, QStringList(nd->getId()), url.path(), QStringList(QLatin1String( "--armor" )), true);
@@ -1442,7 +1442,7 @@ void KeysManager::slotexport()
QPointer<KeyExport> page = new KeyExport(this, serverList);
- page->newFilename->setUrl(sname);
+ page->newFilename->setUrl(QUrl(sname));
if (!m_online)
page->checkServer->setEnabled(false);
@@ -2536,9 +2536,9 @@ void KeysManager::slotPreImportKey()
if (dial->exec() == QDialog::Accepted) {
if (page->checkFile->isChecked()) {
- KUrl impname = page->newFilename->url();
+ QUrl impname = page->newFilename->url();
if (!impname.isEmpty())
- slotImport(KUrl::List(impname));
+ slotImport(QList<QUrl>({impname}));
} else if (page->checkServer->isChecked()) {
const QString ids(page->keyIds->text().simplified());
if (!ids.isEmpty())
@@ -2575,7 +2575,7 @@ void KeysManager::slotImport(const QString &text)
startImport(imp);
}
-void KeysManager::slotImport(const KUrl::List &files)
+void KeysManager::slotImport(const QList<QUrl> &files)
{
startImport(new KGpgImport(this, files));
}
@@ -2811,7 +2811,7 @@ KeysManager::slotOpenKeyUrl()
url.replace(QLatin1String("$$id16$$"), id.toLower());
url.replace(QLatin1String("$$fpr$$"), id.toLower());
- new KRun(url, this);
+ new KRun(QUrl(url), this);
}
void
diff --git a/keysmanager.h b/keysmanager.h
index 0d2e8d3..e1ab90a 100644
--- a/keysmanager.h
+++ b/keysmanager.h
@@ -23,7 +23,7 @@
#include <KDialog>
#include <KToggleAction>
-#include <KUrl>
+#include <QUrl>
#include <KXmlGuiWindow>
#include <QClipboard>
#include <QSet>
@@ -111,7 +111,7 @@ public slots:
void showOptions();
void slotOpenEditor();
void slotImport(const QString &text);
- void slotImport(const KUrl::List &files);
+ void slotImport(const QList<QUrl> &files);
/**
* When you click on "encrypt the clipboard" in the systray,
* this slot will open the dialog to choose a key and encrypt the
diff --git a/keytreeview.cpp b/keytreeview.cpp
index ceef7fd..2a9d3d2 100644
--- a/keytreeview.cpp
+++ b/keytreeview.cpp
@@ -27,6 +27,8 @@
#include <KConfigGroup>
#include <KLocale>
#include <KMessageBox>
+#include <KUrlMimeData>
+
#include <QDrag>
#include <QDragMoveEvent>
#include <QDropEvent>
@@ -157,13 +159,13 @@ KeyTreeView::saveLayout(KConfigGroup &cg) const
void
KeyTreeView::contentsDragMoveEvent(QDragMoveEvent *e)
{
- e->setAccepted(KUrl::List::canDecode(e->mimeData()));
+ e->setAccepted(e->mimeData()->hasUrls());
}
void
KeyTreeView::contentsDropEvent(QDropEvent *o)
{
- KUrl::List uriList = KUrl::List::fromMimeData(o->mimeData());
+ QList<QUrl> uriList = KUrlMimeData::urlsFromMimeData(o->mimeData());
if (!uriList.isEmpty()) {
if (KMessageBox::questionYesNo(this, i18n("<p>Do you want to import file <b>%1</b> into your key ring?</p>",
uriList.first().path()), QString(), KGuiItem(i18n("Import")),
diff --git a/keytreeview.h b/keytreeview.h
index 06430c9..04a2b54 100644
--- a/keytreeview.h
+++ b/keytreeview.h
@@ -21,7 +21,7 @@
#include <QTreeView>
-#include <KUrl>
+#include <QUrl>
#include "core/kgpgkey.h"
@@ -50,7 +50,7 @@ public:
bool isEditing() const;
signals:
- void importDrop(const KUrl::List &urls);
+ void importDrop(const QList<QUrl> &urls);
void returnPressed();
public slots:
diff --git a/kgpg.cpp b/kgpg.cpp
index 3428244..11da910 100644
--- a/kgpg.cpp
+++ b/kgpg.cpp
@@ -112,13 +112,13 @@ int KGpgApp::newInstance()
s_keyManager->slotOpenEditor();
s_keyManager->hide();
} else {
- KUrl::List urlList;
+ QList<QUrl> urlList;
for (int ct = 0; ct < args->count(); ct++)
urlList.append(args->url(ct));
bool directoryInside = false;
- foreach (const KUrl &url, urlList) {
+ foreach (const QUrl &url, urlList) {
QMimeDatabase db;
if (db.mimeTypeForUrl(url).name() == QLatin1String( "inode/directory" )) {
directoryInside = true;
@@ -167,7 +167,7 @@ int KGpgApp::newInstance()
} else {
bool haskeys = false;
bool hastext = false;
- foreach (const KUrl &url, urlList) {
+ foreach (const QUrl &url, urlList) {
QFile qfile(url.path());
if (qfile.open(QIODevice::ReadOnly)) {
const int probelen = 4096;
diff --git a/kgpgexternalactions.cpp b/kgpgexternalactions.cpp
index 53e3cd3..de72f7e 100644
--- a/kgpgexternalactions.cpp
+++ b/kgpgexternalactions.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2002 Jean-Baptiste Mardelle <bj@altern.org>
* Copyright (C) 2008,2009,2010,2011,2012,2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
+ * Copyright (C) 2016 Andrius Štikoans <andrius@stikonas.eu>
*/
/***************************************************************************
@@ -60,7 +61,7 @@ KGpgExternalActions::~KGpgExternalActions()
delete m_kgpgfoldertmp;
}
-void KGpgExternalActions::encryptFiles(KeysManager *parent, const KUrl::List &urls)
+void KGpgExternalActions::encryptFiles(KeysManager *parent, const QList<QUrl> &urls)
{
Q_ASSERT(!urls.isEmpty());
@@ -122,7 +123,7 @@ void KGpgExternalActions::slotEncryptionKeySelected()
deleteLater();
}
-void KGpgExternalActions::encryptFolders(KeysManager *parent, const KUrl::List &urls)
+void KGpgExternalActions::encryptFolders(KeysManager *parent, const QList<QUrl> &urls)
{
QTemporaryFile *tmpfolder = new QTemporaryFile();
@@ -171,7 +172,7 @@ void KGpgExternalActions::startFolderEncode()
Q_ASSERT(dialog != Q_NULLPTR);
dialog->deleteLater();
- const KUrl::List urls = dialog->getFiles();
+ const QList<QUrl> urls = dialog->getFiles();
QStringList selec = dialog->selectedKeys();
KGpgEncrypt::EncryptOptions encOptions = KGpgEncrypt::DefaultEncryption;
@@ -198,7 +199,7 @@ void KGpgExternalActions::startFolderEncode()
if (dialog->getUntrusted())
encOptions |= KGpgEncrypt::AllowUntrustedEncryption;
- QUrl encryptedFile(KUrl::fromPath(urls.first().path(KUrl::RemoveTrailingSlash) + extension));
+ QUrl encryptedFile(QUrl::fromLocalFile(urls.first().adjusted(QUrl::StripTrailingSlash).path() + extension));
QFile encryptedFolder(encryptedFile.path());
dialog->hide();
if (encryptedFolder.exists()) {
@@ -232,7 +233,7 @@ void KGpgExternalActions::slotFolderFinished(KJob *job)
deleteLater();
}
-void KGpgExternalActions::verifyFile(KUrl url)
+void KGpgExternalActions::verifyFile(QUrl url)
{
// check file signature
if (url.isEmpty())
@@ -252,10 +253,10 @@ void KGpgExternalActions::verifyFile(KUrl url)
}
} else {
sigfile = url.path();
- url = KUrl(sigfile.left(sigfile.length() - 4));
+ url = QUrl(sigfile.left(sigfile.length() - 4));
}
- KGpgVerify *kgpv = new KGpgVerify(parent(), KUrl::List(sigfile));
+ KGpgVerify *kgpv = new KGpgVerify(parent(), QList<QUrl>({QUrl(sigfile)}));
connect(kgpv, SIGNAL(done(int)), SLOT(slotVerificationDone(int)));
kgpv->start();
}
@@ -286,7 +287,7 @@ void KGpgExternalActions::slotVerificationDone(int result)
}
}
-void KGpgExternalActions::signFiles(KeysManager* parent, const KUrl::List& urls)
+void KGpgExternalActions::signFiles(KeysManager* parent, const QList<QUrl>& urls)
{
Q_ASSERT(!urls.isEmpty());
@@ -331,7 +332,7 @@ void KGpgExternalActions::slotSignFiles()
deleteLater();
}
-void KGpgExternalActions::decryptFiles(KeysManager* parent, const KUrl::List &urls)
+void KGpgExternalActions::decryptFiles(KeysManager* parent, const QList<QUrl> &urls)
{
KGpgExternalActions *decActions = new KGpgExternalActions(parent, parent->getModel());
@@ -340,7 +341,7 @@ void KGpgExternalActions::decryptFiles(KeysManager* parent, const KUrl::List &ur
decActions->decryptFile(urls);
}
-void KGpgExternalActions::decryptFile(KUrl::List urls)
+void KGpgExternalActions::decryptFile(QList<QUrl> urls)
{
if (urls.isEmpty()) {
deleteLater();
@@ -351,7 +352,7 @@ void KGpgExternalActions::decryptFile(KUrl::List urls)
showDroppedFile(urls.takeFirst());
}
- KUrl first = urls.first();
+ QUrl first = urls.first();
QString oldname(first.fileName());
if (oldname.endsWith(QLatin1String(".gpg"), Qt::CaseInsensitive) ||
@@ -361,7 +362,7 @@ void KGpgExternalActions::decryptFile(KUrl::List urls)
else
oldname.append(QLatin1String( ".clear" ));
- QUrl swapname(first.directory(KUrl::AppendTrailingSlash) + oldname);
+ QUrl swapname(first.adjusted(QUrl::RemoveFilename).path() + oldname);
QFile fgpg(swapname.path());
if (fgpg.exists()) {
QPointer<KIO::RenameDialog> over = new KIO::RenameDialog(m_keysmanager,
@@ -399,16 +400,19 @@ void KGpgExternalActions::slotDecryptionDone(int status)
decryptFile(droppedUrls);
} else {
if (!m_decryptionFailed.isEmpty()) {
+ QStringList failedFiles;
+ for (const QUrl &url : m_decryptionFailed)
+ failedFiles.append(url.toDisplayString());
KMessageBox::errorList(Q_NULLPTR,
i18np("Decryption of this file failed:", "Decryption of these files failed:",
- m_decryptionFailed.count()), m_decryptionFailed.toStringList(),
+ m_decryptionFailed.count()), failedFiles,
i18n("Decryption failed."));
}
deleteLater();
}
}
-void KGpgExternalActions::showDroppedFile(const KUrl &file)
+void KGpgExternalActions::showDroppedFile(const QUrl &file)
{
KgpgEditor *kgpgtxtedit = new KgpgEditor(m_keysmanager, m_model, 0);
connect(m_keysmanager, SIGNAL(fontChanged(QFont)), kgpgtxtedit, SLOT(slotSetFont(QFont)));
diff --git a/kgpgexternalactions.h b/kgpgexternalactions.h
index bc698e8..615d02f 100644
--- a/kgpgexternalactions.h
+++ b/kgpgexternalactions.h
@@ -20,7 +20,7 @@
#include <QPointer>
#include <QStringList>
-#include <KUrl>
+#include <QUrl>
class KeysManager;
class KGpgFirstAssistant;
@@ -44,21 +44,21 @@ public:
KGpgExternalActions(KeysManager *parent, KGpgItemModel *model);
~KGpgExternalActions();
- void showDroppedFile(const KUrl &file);
- void verifyFile(KUrl url);
+ void showDroppedFile(const QUrl &file);
+ void verifyFile(QUrl url);
/**
* @brief create a detached signature for the given files
*/
- static void signFiles(KeysManager* parent, const KUrl::List &urls);
+ static void signFiles(KeysManager* parent, const QList<QUrl> &urls);
- static void decryptFiles(KeysManager* parent, const KUrl::List& urls);
- static void encryptFolders(KeysManager* parent, const KUrl::List &urls);
+ static void decryptFiles(KeysManager* parent, const QList<QUrl>& urls);
+ static void encryptFolders(KeysManager* parent, const QList<QUrl> &urls);
/**
* @brief create a new object, encrypt the given files, and destroy the object
*/
- static void encryptFiles(KeysManager* parent, const KUrl::List& urls);
+ static void encryptFiles(KeysManager* parent, const QList<QUrl>& urls);
signals:
void createNewKey();
void updateDefault(QString);
@@ -74,12 +74,12 @@ private:
void startAssistant();
void firstRun();
- KUrl::List m_decryptionFailed;
+ QList<QUrl> m_decryptionFailed;
KeysManager *m_keysmanager;
- KUrl::List droppedUrls;
+ QList<QUrl> droppedUrls;
QKeySequence goDefaultKey() const;
- void decryptFile(KUrl::List urls);
+ void decryptFile(QList<QUrl> urls);
private slots:
void startFolderEncode();
diff --git a/kgpgfirstassistant.cpp b/kgpgfirstassistant.cpp
index 648962b..1078999 100644
--- a/kgpgfirstassistant.cpp
+++ b/kgpgfirstassistant.cpp
@@ -26,7 +26,7 @@
#include <KComboBox>
#include <KLocale>
#include <KMessageBox>
-#include <KUrl>
+#include <QUrl>
#include <KUrlRequester>
#include <QCheckBox>
@@ -115,7 +115,7 @@ KGpgFirstAssistant::KGpgFirstAssistant(QWidget *parent)
gpgBin = QStandardPaths::findExecutable(QLatin1String("gpg"));
if (gpgBin.isEmpty())
gpgBin = QLatin1String("gpg");
- binURL->setUrl(KUrl::fromPath(gpgBin));
+ binURL->setUrl(QUrl::fromLocalFile(gpgBin));
connect(binURL, SIGNAL(textChanged(QString)), SLOT(slotBinaryChanged(QString)));
slotBinaryChanged(gpgBin);
@@ -262,7 +262,7 @@ KGpgFirstAssistant::findConfigPath()
}
}
- pathURL->setUrl(confPath);
+ pathURL->setUrl(QUrl::fromLocalFile(confPath));
QStringList secids = KgpgInterface::readSecretKeys();
if (secids.isEmpty()) {
diff --git a/kgpgoptions.cpp b/kgpgoptions.cpp
index 28dcfd6..339c841 100644
--- a/kgpgoptions.cpp
+++ b/kgpgoptions.cpp
@@ -25,16 +25,16 @@
#include <KConfig>
#include <KDebug>
#include <KDesktopFile>
-#include <KFileDialog>
#include <KFontChooser>
#include <KInputDialog>
#include <KLocale>
#include <KMessageBox>
#include <KProcess>
-#include <KUrl>
+#include <QUrl>
#include <QCheckBox>
#include <QFile>
+#include <QFileDialog>
#include <QTextStream>
#include <QVBoxLayout>
#include <QStandardPaths>
@@ -87,8 +87,8 @@ kgpgOptions::kgpgOptions(QWidget *parent, KGpgItemModel *model)
serverList.prepend(keyServer);
m_page6->ServerBox->setModel(m_serverModel);
- defaultConfigPath = KUrl::fromPath(gpgConfigPath).fileName();
- defaultHomePath = KUrl::fromPath(gpgConfigPath).directory(KUrl::AppendTrailingSlash);
+ defaultConfigPath = QUrl::fromLocalFile(gpgConfigPath).fileName();
+ defaultHomePath = QUrl::fromLocalFile(gpgConfigPath).adjusted(QUrl::RemoveFilename).path();
defaultBinPath = KGpgSettings::gpgBinaryPath();
m_showsystray = KGpgSettings::showSystray();
@@ -148,7 +148,7 @@ kgpgOptions::~kgpgOptions()
void kgpgOptions::slotChangeHome()
{
- QString gpgHome = KFileDialog::getExistingDirectory(m_page4->gpg_home_path->text(), this, i18n("New GnuPG Home Location"));
+ QString gpgHome = QFileDialog::getExistingDirectory(this, i18n("New GnuPG Home Location"), m_page4->gpg_home_path->text());
if (gpgHome.isEmpty())
return;
@@ -318,8 +318,8 @@ void kgpgOptions::updateWidgets()
}
gpgConfigPath = KGpgSettings::gpgConfigPath();
- m_page4->gpg_conf_path->setText(KUrl::fromPath(gpgConfigPath).fileName());
- m_page4->gpg_home_path->setText(KUrl::fromPath(gpgConfigPath).directory(KUrl::AppendTrailingSlash));
+ m_page4->gpg_conf_path->setText(QUrl::fromLocalFile(gpgConfigPath).fileName());
+ m_page4->gpg_home_path->setText(QUrl::fromLocalFile(gpgConfigPath).adjusted(QUrl::RemoveFilename).path());
m_useagent = KgpgInterface::getGpgBoolSetting(QLatin1String( "use-agent" ), KGpgSettings::gpgConfigPath());
m_defaultuseagent = false;
@@ -535,10 +535,10 @@ bool kgpgOptions::hasChanged()
(m_page1->always_key->itemData(m_page1->always_key->currentIndex(), Qt::ToolTipRole).toString()) != alwaysKeyID)
return true;
- if (m_page4->gpg_conf_path->text() != KUrl::fromPath(gpgConfigPath).fileName())
+ if (m_page4->gpg_conf_path->text() != QUrl::fromLocalFile(gpgConfigPath).fileName())
return true;
- if (m_page4->gpg_home_path->text() != KUrl::fromPath(gpgConfigPath).directory(KUrl::AppendTrailingSlash))
+ if (m_page4->gpg_home_path->text() != QUrl::fromLocalFile(gpgConfigPath).adjusted(QUrl::RemoveFilename).path())
return true;
if (m_page4->use_agent->isChecked() != m_useagent)
diff --git a/kgpgrevokewidget.cpp b/kgpgrevokewidget.cpp
index 0b46e5e..11992d0 100644
--- a/kgpgrevokewidget.cpp
+++ b/kgpgrevokewidget.cpp
@@ -18,7 +18,7 @@
#include "core/KGpgKeyNode.h"
-#include <KUrl>
+#include <QUrl>
#include <QDir>
KgpgRevokeWidget::KgpgRevokeWidget(QWidget* parent)
@@ -46,7 +46,7 @@ KGpgRevokeDialog::KGpgRevokeDialog(QWidget* parent, const KGpgKeyNode *node)
m_revWidget->keyID->setText(i18nc("<Name> (<Email>) ID: <KeyId>", "%1 (%2) ID: %3",
node->getName(), node->getEmail(), m_id));
- m_revWidget->outputFile->setUrl(QString(QDir::homePath() + QLatin1Char( '/' ) + node->getEmail().section( QLatin1Char( '@' ), 0, 0 ) + QLatin1String( ".revoke" ) ));
+ m_revWidget->outputFile->setUrl(QUrl(QDir::homePath() + QLatin1Char( '/' ) + node->getEmail().section( QLatin1Char( '@' ), 0, 0 ) + QLatin1String( ".revoke" ) ));
m_revWidget->outputFile->setMode(KFile::File);
setMinimumSize(m_revWidget->sizeHint());
@@ -63,12 +63,12 @@ int KGpgRevokeDialog::getReason() const
return m_revWidget->comboBox1->currentIndex();
}
-KUrl KGpgRevokeDialog::saveUrl() const
+QUrl KGpgRevokeDialog::saveUrl() const
{
if (m_revWidget->cbSave->isChecked())
return m_revWidget->outputFile->url();
else
- return KUrl();
+ return QUrl();
}
QString KGpgRevokeDialog::getId() const
diff --git a/kgpgrevokewidget.h b/kgpgrevokewidget.h
index 3d4518c..a1e71a8 100644
--- a/kgpgrevokewidget.h
+++ b/kgpgrevokewidget.h
@@ -23,7 +23,7 @@
#include "ui_kgpgrevokewidget.h"
class KGpgKeyNode;
-class KUrl;
+class QUrl;
class KgpgRevokeWidget : public QWidget, public Ui_KgpgRevokeWidget
{
@@ -48,7 +48,7 @@ public:
QString getDescription() const;
int getReason() const;
- KUrl saveUrl() const;
+ QUrl saveUrl() const;
QString getId() const;
bool printChecked();
bool importChecked();
diff --git a/kgpgtextinterface.cpp b/kgpgtextinterface.cpp
index 016ec61..e1e5151 100644
--- a/kgpgtextinterface.cpp
+++ b/kgpgtextinterface.cpp
@@ -29,7 +29,7 @@ public:
GPGProc * const m_process;
int m_step;
const QStringList m_gpgopts;
- KUrl::List m_files;
+ QList<QUrl> m_files;
void signFile(const QString &fileName);
};
@@ -78,7 +78,7 @@ KGpgTextInterface::~KGpgTextInterface()
// signatures
void
-KGpgTextInterface::signFiles(const KUrl::List &srcUrls)
+KGpgTextInterface::signFiles(const QList<QUrl> &srcUrls)
{
d->m_files = srcUrls;
diff --git a/kgpgtextinterface.h b/kgpgtextinterface.h
index 195ec50..524de8a 100644
--- a/kgpgtextinterface.h
+++ b/kgpgtextinterface.h
@@ -15,7 +15,8 @@
#ifndef KGPGTEXTINTERFACE_H
#define KGPGTEXTINTERFACE_H
-#include <KUrl>
+#include <QObject>
+#include <QUrl>
class KGpgTextInterfacePrivate;
class QString;
@@ -48,7 +49,7 @@ public Q_SLOTS:
* @param srcUrl file to sign.
* @param options additional gpg options, e.g. "--armor"
*/
- void signFiles(const KUrl::List &srcUrl);
+ void signFiles(const QList<QUrl> &srcUrl);
private Q_SLOTS:
void slotSignFile();
diff --git a/selectpublickeydialog.cpp b/selectpublickeydialog.cpp
index 4dd7257..560c8f1 100644
--- a/selectpublickeydialog.cpp
+++ b/selectpublickeydialog.cpp
@@ -35,7 +35,7 @@
using namespace KgpgCore;
-KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const KUrl::List &files)
+KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const QList<QUrl> &files)
: KDialog(parent),
m_customoptions(Q_NULLPTR),
imodel(model),
@@ -195,7 +195,7 @@ bool KgpgSelectPublicKeyDlg::getArmor() const
return m_hideasciioption || m_cbarmor->isChecked();
}
-const KUrl::List &KgpgSelectPublicKeyDlg::getFiles() const
+const QList<QUrl> &KgpgSelectPublicKeyDlg::getFiles() const
{
return m_files;
}
diff --git a/selectpublickeydialog.h b/selectpublickeydialog.h
index da782a7..0f6c3c9 100644
--- a/selectpublickeydialog.h
+++ b/selectpublickeydialog.h
@@ -20,7 +20,7 @@
#include <KDialog>
#include <QKeySequence>
-#include <KUrl>
+#include <QUrl>
#include <KVBox>
#include <QKeySequence>
@@ -44,7 +44,7 @@ public:
/* TODO: the goDefaultKey shortcut should be stored in a way it can be accessed from everywhere. So we don't have to pass it as an argument.
*/
- KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const KUrl::List &files = KUrl::List());
+ KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const QList<QUrl> &files = QList<QUrl>());
QStringList selectedKeys() const;
QString getCustomOptions() const;
@@ -55,7 +55,7 @@ public:
/**
* @brief return the files passed in the constructor
*/
- const KUrl::List &getFiles() const;
+ const QList<QUrl> &getFiles() const;
KVBox *optionsbox;
@@ -78,7 +78,7 @@ private:
QLineEdit *m_searchlineedit;
SelectKeyProxyModel *iproxy;
KGpgItemModel *imodel;
- const KUrl::List m_files;
+ const QList<QUrl> m_files;
bool m_hideasciioption;
};
diff --git a/transactions/kgpgdecrypt.cpp b/transactions/kgpgdecrypt.cpp
index 40cd26d..c3c5020 100644
--- a/transactions/kgpgdecrypt.cpp
+++ b/transactions/kgpgdecrypt.cpp
@@ -25,15 +25,15 @@ KGpgDecrypt::KGpgDecrypt(QObject *parent, const QString &text)
{
}
-KGpgDecrypt::KGpgDecrypt(QObject *parent, const KUrl::List &files)
+KGpgDecrypt::KGpgDecrypt(QObject *parent, const QList<QUrl> &files)
: KGpgTextOrFileTransaction(parent, files),
m_fileIndex(0),
m_plainLength(-1)
{
}
-KGpgDecrypt::KGpgDecrypt(QObject* parent, const KUrl& infile, const KUrl& outfile)
- : KGpgTextOrFileTransaction(parent, KUrl::List(infile)),
+KGpgDecrypt::KGpgDecrypt(QObject* parent, const QUrl& infile, const QUrl& outfile)
+ : KGpgTextOrFileTransaction(parent, QList<QUrl>({infile})),
m_fileIndex(0),
m_plainLength(-1),
m_outFilename(outfile.toLocalFile())
@@ -111,7 +111,7 @@ KGpgDecrypt::isEncryptedText(const QString &text, int *startPos, int *endPos)
bool
KGpgDecrypt::nextLine(const QString& line)
{
- const KUrl::List &inputFiles = getInputFiles();
+ const QList<QUrl> &inputFiles = getInputFiles();
if (!inputFiles.isEmpty()) {
if (line == QLatin1String("[GNUPG:] BEGIN_DECRYPTION")) {
diff --git a/transactions/kgpgdecrypt.h b/transactions/kgpgdecrypt.h
index a53216c..62b97b1 100644
--- a/transactions/kgpgdecrypt.h
+++ b/transactions/kgpgdecrypt.h
@@ -16,7 +16,7 @@
#include <QObject>
-#include <KUrl>
+#include <QUrl>
#include "kgpgtextorfiletransaction.h"
@@ -43,7 +43,7 @@ public:
* @param parent parent object
* @param files list of file locations to decrypt
*/
- KGpgDecrypt(QObject *parent, const KUrl::List &files);
+ KGpgDecrypt(QObject *parent, const QList<QUrl> &files);
/**
* @brief decrypt file to given output filename
@@ -51,7 +51,7 @@ public:
* @param infile name of file to decrypt
* @param outfile name of file to write output to (will be overwritten)
*/
- KGpgDecrypt(QObject *parent, const KUrl &infile, const KUrl &outfile);
+ KGpgDecrypt(QObject *parent, const QUrl &infile, const QUrl &outfile);
/**
* @brief destructor
diff --git a/transactions/kgpgencrypt.cpp b/transactions/kgpgencrypt.cpp
index 0c35484..11ae480 100644
--- a/transactions/kgpgencrypt.cpp
+++ b/transactions/kgpgencrypt.cpp
@@ -40,7 +40,7 @@ KGpgEncrypt::KGpgEncrypt(QObject *parent, const QStringList &userIds, const QStr
m_extraOptions << trustOptions(getProcess()->program().at(0));
}
-KGpgEncrypt::KGpgEncrypt(QObject *parent, const QStringList &userIds, const KUrl::List &files, const EncryptOptions &options, const QStringList &extraOptions)
+KGpgEncrypt::KGpgEncrypt(QObject *parent, const QStringList &userIds, const QList<QUrl> &files, const EncryptOptions &options, const QStringList &extraOptions)
: KGpgTextOrFileTransaction(parent, files),
m_fileIndex(0),
m_options(options),
@@ -95,7 +95,7 @@ KGpgEncrypt::encryptedText() const
bool
KGpgEncrypt::nextLine(const QString &line)
{
- const KUrl::List &inputFiles = getInputFiles();
+ const QList<QUrl> &inputFiles = getInputFiles();
if (!inputFiles.isEmpty()) {
static const QString encStart = QLatin1String("[GNUPG:] FILE_START 2 ");
@@ -116,14 +116,14 @@ KGpgEncrypt::nextLine(const QString &line)
}
KGpgTransaction::ts_boolanswer
-KGpgEncrypt::confirmOverwrite(KUrl &currentFile)
+KGpgEncrypt::confirmOverwrite(QUrl &currentFile)
{
const QString ext = encryptExtension(m_options.testFlag(AsciiArmored));
if (m_currentFile.isEmpty())
- currentFile = KUrl::fromLocalFile(getInputFiles().at(m_fileIndex).toLocalFile() + ext);
+ currentFile = QUrl::fromLocalFile(getInputFiles().at(m_fileIndex).toLocalFile() + ext);
else
- currentFile = KUrl::fromLocalFile(m_currentFile + ext);
+ currentFile = QUrl::fromLocalFile(m_currentFile + ext);
return BA_UNKNOWN;
}
diff --git a/transactions/kgpgencrypt.h b/transactions/kgpgencrypt.h
index 90176c2..9bf7d08 100644
--- a/transactions/kgpgencrypt.h
+++ b/transactions/kgpgencrypt.h
@@ -18,7 +18,7 @@
#include <QString>
#include <QStringList>
-#include <KUrl>
+#include <QUrl>
#include "kgpgtextorfiletransaction.h"
@@ -55,7 +55,7 @@ public:
* @param files list of file locations to encrypt
* @param options encryption options
*/
- KGpgEncrypt(QObject *parent, const QStringList &userIds, const KUrl::List &files, const EncryptOptions &options = DefaultEncryption, const QStringList &extraOptions = QStringList());
+ KGpgEncrypt(QObject *parent, const QStringList &userIds, const QList<QUrl> &files, const EncryptOptions &options = DefaultEncryption, const QStringList &extraOptions = QStringList());
/**
* @brief destructor
@@ -78,7 +78,7 @@ public:
protected:
virtual QStringList command() const Q_DECL_OVERRIDE;
virtual bool nextLine(const QString &line) Q_DECL_OVERRIDE;
- virtual ts_boolanswer confirmOverwrite (KUrl &currentFile) Q_DECL_OVERRIDE;
+ virtual ts_boolanswer confirmOverwrite (QUrl &currentFile) Q_DECL_OVERRIDE;
private:
int m_fileIndex;
diff --git a/transactions/kgpggeneraterevoke.cpp b/transactions/kgpggeneraterevoke.cpp
index d99f366..464c647 100644
--- a/transactions/kgpggeneraterevoke.cpp
+++ b/transactions/kgpggeneraterevoke.cpp
@@ -17,7 +17,7 @@
#include <KLocale>
#include <QFile>
-KGpgGenerateRevoke::KGpgGenerateRevoke(QObject *parent, const QString &keyID, const KUrl &revokeUrl, const int reason, const QString &description)
+KGpgGenerateRevoke::KGpgGenerateRevoke(QObject *parent, const QString &keyID, const QUrl &revokeUrl, const int reason, const QString &description)
: KGpgTransaction(parent),
m_keyid(keyID),
m_revUrl(revokeUrl),
@@ -111,7 +111,7 @@ KGpgGenerateRevoke::passphraseReceived()
}
KGpgTransaction::ts_boolanswer
-KGpgGenerateRevoke::confirmOverwrite(KUrl &currentFile)
+KGpgGenerateRevoke::confirmOverwrite(QUrl &currentFile)
{
currentFile = m_revUrl;
return BA_UNKNOWN;
diff --git a/transactions/kgpggeneraterevoke.h b/transactions/kgpggeneraterevoke.h
index 3d3a9bd..0281468 100644
--- a/transactions/kgpggeneraterevoke.h
+++ b/transactions/kgpggeneraterevoke.h
@@ -18,7 +18,7 @@
#include "core/kgpgkey.h"
-#include <KUrl>
+#include <QUrl>
#include <QObject>
class QString;
@@ -40,7 +40,7 @@ public:
* @param reason revokation reason
* @param description text description for revokation
*/
- KGpgGenerateRevoke(QObject *parent, const QString &keyID, const KUrl &revokeUrl, const int reason, const QString &description);
+ KGpgGenerateRevoke(QObject *parent, const QString &keyID, const QUrl &revokeUrl, const int reason, const QString &description);
virtual ~KGpgGenerateRevoke();
/**
@@ -57,11 +57,11 @@ protected:
virtual ts_boolanswer boolQuestion(const QString &line) Q_DECL_OVERRIDE;
virtual void finish() Q_DECL_OVERRIDE;
virtual bool passphraseReceived() Q_DECL_OVERRIDE;
- virtual ts_boolanswer confirmOverwrite (KUrl &currentFile) Q_DECL_OVERRIDE;
+ virtual ts_boolanswer confirmOverwrite (QUrl &currentFile) Q_DECL_OVERRIDE;
private:
QString m_keyid;
- KUrl m_revUrl;
+ QUrl m_revUrl;
int m_reason;
QString m_description;
QString m_output;
diff --git a/transactions/kgpgimport.cpp b/transactions/kgpgimport.cpp
index e42f046..da92f41 100644
--- a/transactions/kgpgimport.cpp
+++ b/transactions/kgpgimport.cpp
@@ -24,7 +24,7 @@ KGpgImport::KGpgImport(QObject *parent, const QString &text)
{
}
-KGpgImport::KGpgImport(QObject *parent, const KUrl::List &files)
+KGpgImport::KGpgImport(QObject *parent, const QList<QUrl> &files)
: KGpgTextOrFileTransaction(parent, files, true)
{
}
diff --git a/transactions/kgpgimport.h b/transactions/kgpgimport.h
index aed4f5b..adbdcd4 100644
--- a/transactions/kgpgimport.h
+++ b/transactions/kgpgimport.h
@@ -18,7 +18,7 @@
#include <QString>
#include <QStringList>
-#include <KUrl>
+#include <QUrl>
#include "kgpgtextorfiletransaction.h"
@@ -44,7 +44,7 @@ public:
* @param parent parent object
* @param files list of file locations to import from
*/
- KGpgImport(QObject *parent, const KUrl::List &files);
+ KGpgImport(QObject *parent, const QList<QUrl> &files);
/**
* @brief destructor
diff --git a/transactions/kgpgsigntext.cpp b/transactions/kgpgsigntext.cpp
index 68f26c8..ef43732 100644
--- a/transactions/kgpgsigntext.cpp
+++ b/transactions/kgpgsigntext.cpp
@@ -24,7 +24,7 @@ KGpgSignText::KGpgSignText(QObject *parent, const QString &signId, const QString
{
}
-KGpgSignText::KGpgSignText(QObject *parent, const QString &signId, const KUrl::List &files, const SignOptions &options, const QStringList &extraOptions)
+KGpgSignText::KGpgSignText(QObject *parent, const QString &signId, const QList<QUrl> &files, const SignOptions &options, const QStringList &extraOptions)
: KGpgTextOrFileTransaction(parent, files),
m_fileIndex(0),
m_options(options),
@@ -44,7 +44,7 @@ KGpgSignText::command() const
{
QStringList ret = m_extraOptions;
- const KUrl::List &files = getInputFiles();
+ const QList<QUrl> &files = getInputFiles();
QString fileName;
if (!files.isEmpty())
diff --git a/transactions/kgpgsigntext.h b/transactions/kgpgsigntext.h
index bbde912..e4b05b7 100644
--- a/transactions/kgpgsigntext.h
+++ b/transactions/kgpgsigntext.h
@@ -16,7 +16,7 @@
#include "kgpgtextorfiletransaction.h"
-#include <KUrl>
+#include <QUrl>
#include <QObject>
#include <QString>
#include <QStringList>
@@ -56,7 +56,7 @@ public:
* @warning GnuPG can currently handle only one file per invocation for
* signing, so files may only contain one single file.
*/
- KGpgSignText(QObject *parent, const QString &signId, const KUrl::List &files, const SignOptions &options = DefaultSignature, const QStringList &extraOptions = QStringList());
+ KGpgSignText(QObject *parent, const QString &signId, const QList<QUrl> &files, const SignOptions &options = DefaultSignature, const QStringList &extraOptions = QStringList());
/**
* @brief destructor
diff --git a/transactions/kgpgtextorfiletransaction.cpp b/transactions/kgpgtextorfiletransaction.cpp
index f2d5338..d38f250 100644
--- a/transactions/kgpgtextorfiletransaction.cpp
+++ b/transactions/kgpgtextorfiletransaction.cpp
@@ -25,7 +25,7 @@ KGpgTextOrFileTransaction::KGpgTextOrFileTransaction(QObject *parent, const QStr
setText(text);
}
-KGpgTextOrFileTransaction::KGpgTextOrFileTransaction(QObject *parent, const KUrl::List &files, const bool allowChaining)
+KGpgTextOrFileTransaction::KGpgTextOrFileTransaction(QObject *parent, const QList<QUrl> &files, const bool allowChaining)
: KGpgTransaction(parent, allowChaining)
{
setUrls(files);
@@ -75,7 +75,7 @@ KGpgTextOrFileTransaction::setText(const QString &text)
}
void
-KGpgTextOrFileTransaction::setUrls(const KUrl::List &files)
+KGpgTextOrFileTransaction::setUrls(const QList<QUrl> &files)
{
m_text.clear();
m_inpfiles = files;
@@ -86,7 +86,7 @@ KGpgTextOrFileTransaction::preStart()
{
QStringList locfiles;
- foreach (const KUrl &url, m_inpfiles) {
+ foreach (const QUrl &url, m_inpfiles) {
if (url.isLocalFile()) {
locfiles.append(url.toLocalFile());
} else {
@@ -171,7 +171,7 @@ KGpgTextOrFileTransaction::cleanUrls()
m_inpfiles.clear();
}
-const KUrl::List &
+const QList<QUrl> &
KGpgTextOrFileTransaction::getInputFiles() const
{
return m_inpfiles;
diff --git a/transactions/kgpgtextorfiletransaction.h b/transactions/kgpgtextorfiletransaction.h
index c5b7dff..5e46441 100644
--- a/transactions/kgpgtextorfiletransaction.h
+++ b/transactions/kgpgtextorfiletransaction.h
@@ -18,7 +18,7 @@
#include <QString>
#include <QStringList>
-#include <KUrl>
+#include <QUrl>
#include "kgpgtransaction.h"
@@ -51,7 +51,7 @@ protected:
* @param parent parent object
* @param keys list of file locations to work with
*/
- KGpgTextOrFileTransaction(QObject *parent, const KUrl::List &files, const bool allowChaining = false);
+ KGpgTextOrFileTransaction(QObject *parent, const QList<QUrl> &files, const bool allowChaining = false);
public:
/**
@@ -68,7 +68,7 @@ public:
* @brief set file locations to work with
* @param keys list of file locations to work with
*/
- void setUrls(const KUrl::List &files);
+ void setUrls(const QList<QUrl> &files);
/**
* @brief get gpg info message
@@ -89,12 +89,12 @@ protected:
virtual QStringList command() const = 0;
- const KUrl::List &getInputFiles() const;
+ const QList<QUrl> &getInputFiles() const;
private:
QStringList m_tempfiles;
QStringList m_locfiles;
- KUrl::List m_inpfiles;
+ QList<QUrl> m_inpfiles;
QString m_text;
QStringList m_messages;
bool m_closeInput; ///< if input channel of GnuPG should be closed after m_text is written
diff --git a/transactions/kgpgtransaction.cpp b/transactions/kgpgtransaction.cpp
index b080ef6..8f3cb63 100644
--- a/transactions/kgpgtransaction.cpp
+++ b/transactions/kgpgtransaction.cpp
@@ -23,7 +23,7 @@
#include <knewpassworddialog.h>
#include <KLocale>
#include <KPushButton>
-#include <KUrl>
+#include <QUrl>
#include <QByteArray>
#include <QPointer>
#include <QStringList>
@@ -377,7 +377,7 @@ KGpgTransaction::boolQuestion(const QString& line)
}
KGpgTransaction::ts_boolanswer
-KGpgTransaction::confirmOverwrite(KUrl &currentFile)
+KGpgTransaction::confirmOverwrite(QUrl &currentFile)
{
Q_UNUSED(currentFile)
diff --git a/transactions/kgpgtransaction.h b/transactions/kgpgtransaction.h
index 4642d23..6e6c8e9 100644
--- a/transactions/kgpgtransaction.h
+++ b/transactions/kgpgtransaction.h
@@ -23,7 +23,7 @@
class GPGProc;
class KGpgSignTransactionHelper;
class KGpgTransactionPrivate;
-class KUrl;
+class QUrl;
class QByteArray;
/**
@@ -239,7 +239,7 @@ protected:
* The default implementation will just return BA_UNKNOWN without setting
* a filename, causing a sequence error.
*/
- virtual ts_boolanswer confirmOverwrite(KUrl &currentFile);
+ virtual ts_boolanswer confirmOverwrite(QUrl &currentFile);
/**
* @brief Called for a set of hint messages
diff --git a/transactions/kgpgtransactionprivate.h b/transactions/kgpgtransactionprivate.h
index f0322b1..9282480 100644
--- a/transactions/kgpgtransactionprivate.h
+++ b/transactions/kgpgtransactionprivate.h
@@ -16,7 +16,7 @@
#include "gpgproc.h"
-#include <KUrl>
+#include <QUrl>
#include <KPasswordDialog>
#include <KNewPasswordDialog>
@@ -41,7 +41,7 @@ public:
QStringList m_idhints;
- KUrl m_overwriteUrl; ///< the file to overwrite or it's new name
+ QUrl m_overwriteUrl; ///< the file to overwrite or it's new name
void slotReadReady();
void slotProcessExited();
diff --git a/transactions/kgpgverify.cpp b/transactions/kgpgverify.cpp
index 501a46b..2f5bfa8 100644
--- a/transactions/kgpgverify.cpp
+++ b/transactions/kgpgverify.cpp
@@ -26,7 +26,7 @@ KGpgVerify::KGpgVerify(QObject *parent, const QString &text)
{
}
-KGpgVerify::KGpgVerify(QObject *parent, const KUrl::List &files)
+KGpgVerify::KGpgVerify(QObject *parent, const QList<QUrl> &files)
: KGpgTextOrFileTransaction(parent, files),
m_fileIndex(0)
{
diff --git a/transactions/kgpgverify.h b/transactions/kgpgverify.h
index 8db9f18..806c46e 100644
--- a/transactions/kgpgverify.h
+++ b/transactions/kgpgverify.h
@@ -20,7 +20,7 @@
#include <QString>
#include <QStringList>
-#include <KUrl>
+#include <QUrl>
class KGpgItemModel;
@@ -50,7 +50,7 @@ public:
* @param parent parent object
* @param files list of file locations to verify
*/
- KGpgVerify(QObject *parent, const KUrl::List &files);
+ KGpgVerify(QObject *parent, const QList<QUrl> &files);
/**
* @brief destructor