summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Chowdhury <rahulc93@gmail.com>2015-09-10 19:50:36 (GMT)
committerRahul Chowdhury <rahulc93@gmail.com>2015-09-11 10:11:03 (GMT)
commit08ab3c35e50426962285401bdf152109b7f77cc2 (patch)
tree7e48542e55c41733f0ce0f95adf2896c266b671c
parent70825cdc157f6bb2e708b71901e217ceed87f4b0 (diff)
Port KUrl -> QUrl
REVIEW: 125150
-rw-r--r--plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp1
-rw-r--r--plasmoid/engine/kalzium_engine.cpp1
-rw-r--r--src/detailinfodlg.cpp6
-rw-r--r--src/detailinfodlg.h4
-rw-r--r--src/kalzium.cpp6
-rw-r--r--src/kdeeduglossary.cpp20
-rw-r--r--src/kdeeduglossary.h10
-rw-r--r--src/tools/moleculeview.cpp7
-rw-r--r--src/tools/obconverter.cpp12
9 files changed, 32 insertions, 35 deletions
diff --git a/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp b/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
index e802100..27c1c61 100644
--- a/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
+++ b/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
@@ -31,7 +31,6 @@
#include <klocale.h>
#include <kdebug.h>
-#include <kurl.h>
#include <kstandarddirs.h>
#include <kpixmapcache.h>
#include <QXmlReader>
diff --git a/plasmoid/engine/kalzium_engine.cpp b/plasmoid/engine/kalzium_engine.cpp
index 36fce6f..ea24caa 100644
--- a/plasmoid/engine/kalzium_engine.cpp
+++ b/plasmoid/engine/kalzium_engine.cpp
@@ -23,7 +23,6 @@
#include <QStringList>
#include <KLocale>
-#include <KUrl>
#include <KStandardDirs>
#include <KConfigGroup>
diff --git a/src/detailinfodlg.cpp b/src/detailinfodlg.cpp
index 232adfa..ad55f38 100644
--- a/src/detailinfodlg.cpp
+++ b/src/detailinfodlg.cpp
@@ -32,7 +32,7 @@
#include <KGlobal>
#include <QIcon>
#include <KPageDialog>
-#include <KUrl>
+#include <QUrl>
#include "psetables.h"
#include <QFile>
@@ -128,7 +128,7 @@ KHTMLPart* DetailedInfoDlg::addHTMLTab(const QString& title, const QString& icon
w->setJavaEnabled(false);
w->setMetaRefreshEnabled(false);
w->setPluginsEnabled(false);
- connect(w->browserExtension(), SIGNAL(openUrlRequest(KUrl)), this, SLOT(slotLinkClicked(KUrl)));
+ connect(w->browserExtension(), SIGNAL(openUrlRequest(QUrl)), this, SLOT(slotLinkClicked(QUrl)));
layout->addWidget(w->view());
return w;
@@ -572,7 +572,7 @@ QString DetailedInfoDlg::createWikiLink(QString link, QString displayString)
return html;
}
-void DetailedInfoDlg::slotLinkClicked(const KUrl &url)
+void DetailedInfoDlg::slotLinkClicked(const QUrl &url)
{
if (!url.isEmpty() && url.isValid()) {
KRun *krun = new KRun(url, 0);
diff --git a/src/detailinfodlg.h b/src/detailinfodlg.h
index b1e9d48..9132ed9 100644
--- a/src/detailinfodlg.h
+++ b/src/detailinfodlg.h
@@ -16,7 +16,7 @@
#ifndef DETAILINFODLG_H
#define DETAILINFODLG_H
-#include <KUrl>
+#include <QUrl>
#include <QMap>
#include <KDialog>
#include <KPageDialog>
@@ -126,7 +126,7 @@ private:
QString createWikiLink(QString link);
private slots:
- void slotLinkClicked(const KUrl &url);
+ void slotLinkClicked(const QUrl &url);
virtual void slotUser1();
virtual void slotUser2();
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index bfe8799..50beac1 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -63,7 +63,7 @@
#include <kstandardaction.h>
#include <QIcon>
#include <kservicetypetrader.h>
-#include <KUrl>
+#include <QUrl>
#include <kfiledialog.h>
#include <QLocale>
#include <KPluginLoader>
@@ -344,12 +344,12 @@ void Kalzium::slotGlossary()
m_glossarydlg->setObjectName(QLatin1String("glossary"));
QString dir = KGlobal::dirs()->findResourceDir("data", "kalzium/data/");
QString picturepath = dir + "kalzium/data/bg.jpg";
- KUrl u = KUrl::fromPath(dir + "kalzium/data/knowledge.xml");
+ QUrl u = QUrl::fromLocalFile(dir + "kalzium/data/knowledge.xml");
Glossary *g = new Glossary(u);
g->setName(i18n("Knowledge"));
g->setBackgroundPicture(picturepath);
m_glossarydlg->addGlossary(g, true);
- u = KUrl::fromPath(dir + "kalzium/data/tools.xml");
+ u = QUrl::fromLocalFile(dir + "kalzium/data/tools.xml");
g = new Glossary(u, dir + "kalzium/data/toolpics/");
g->setName(i18n("Tools"));
g->setBackgroundPicture(picturepath);
diff --git a/src/kdeeduglossary.cpp b/src/kdeeduglossary.cpp
index dddfa20..cd73ff9 100644
--- a/src/kdeeduglossary.cpp
+++ b/src/kdeeduglossary.cpp
@@ -105,7 +105,7 @@ class GlossaryDialog::Private
// slots
void itemActivated(QTreeWidgetItem * item, int column);
// The user clicked on a href. Find and display the right item
- void displayItem(const KUrl &url, const KParts::OpenUrlArguments& arguments,
+ void displayItem(const QUrl &url, const KParts::OpenUrlArguments& arguments,
const KParts::BrowserArguments &browserArguments);
GlossaryDialog *q;
@@ -121,14 +121,14 @@ class GlossaryDialog::Private
};
-Glossary::Glossary(const KUrl& url, const QString& path)
+Glossary::Glossary(const QUrl &url, const QString& path)
{
init(url, path);
}
Glossary::Glossary()
{
- init(KUrl(), QString());
+ init(QUrl(), QString());
}
Glossary::~Glossary()
@@ -136,7 +136,7 @@ Glossary::~Glossary()
qDeleteAll(m_itemlist);
}
-void Glossary::init(const KUrl& url, const QString& path)
+void Glossary::init(const QUrl &url, const QString& path)
{
// setting a generic name for a new glossary
m_name = i18n("Glossary");
@@ -155,7 +155,7 @@ void Glossary::init(const KUrl& url, const QString& path)
}
}
-bool Glossary::loadLayout(QDomDocument &Document, const KUrl& url)
+bool Glossary::loadLayout(QDomDocument &Document, const QUrl &url)
{
QFile layoutFile(url.path());
@@ -354,8 +354,8 @@ GlossaryDialog::GlossaryDialog(QWidget *parent) : KDialog(parent), d(new Private
d->m_htmlpart = new KHTMLPart(vs);
- connect(d->m_htmlpart->browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
- this, SLOT(displayItem(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)));
+ connect(d->m_htmlpart->browserExtension(), SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
+ this, SLOT(displayItem(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)));
connect(d->m_glosstree, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
this, SLOT(itemActivated(QTreeWidgetItem*,int)));
@@ -375,9 +375,9 @@ void GlossaryDialog::keyPressEvent(QKeyEvent* e)
KDialog::keyPressEvent(e);
}
-void GlossaryDialog::Private::displayItem(const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &)
+void GlossaryDialog::Private::displayItem(const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &)
{
- // using the "path" part of a kurl as reference
+ // using the "path" part of a qurl as reference
QString myurl = url.path().toLower();
QTreeWidgetItemIterator it(m_glosstree);
@@ -503,7 +503,7 @@ QString GlossaryItem::parseReferences() const
static QString basehref = QString("<li><a href=\"item:%1\" title=\"%2\">%3</a></li>");
foreach (const QString& ref, m_ref) {
- htmlcode += basehref.arg(KUrl::toPercentEncoding(ref), i18n("Go to '%1'", ref), ref);
+ htmlcode += basehref.arg(QUrl::toPercentEncoding(ref), i18n("Go to '%1'", ref), ref);
}
htmlcode += "</ul>";
diff --git a/src/kdeeduglossary.h b/src/kdeeduglossary.h
index d2cdbe9..da6dd34 100644
--- a/src/kdeeduglossary.h
+++ b/src/kdeeduglossary.h
@@ -12,7 +12,7 @@
#define KDEEDUGLOSSARY_H
#include <kdialog.h>
-#include <KUrl>
+#include <QUrl>
class QDomDocument;
class GlossaryItem;
@@ -35,7 +35,7 @@ public:
* @param url the path of the file to load
* @param path the path of the pictures
*/
- explicit Glossary(const KUrl& url, const QString& path = QString());
+ explicit Glossary(const QUrl& url, const QString& path = QString());
/**
* Creates a new empty glossary
@@ -100,7 +100,7 @@ public:
QString backgroundPicture()const;
protected:
- void init(const KUrl& url, const QString& path);
+ void init(const QUrl& url, const QString& path);
private:
/**
@@ -133,7 +133,7 @@ private:
* @return a bool indicating whether the loading of the XML was
* successful or not
*/
- bool loadLayout(QDomDocument& doc, const KUrl& url);
+ bool loadLayout(QDomDocument& doc, const QUrl& url);
QList<GlossaryItem*> m_itemlist;
@@ -234,7 +234,7 @@ private:
Private * const d;
Q_PRIVATE_SLOT(d, void itemActivated(QTreeWidgetItem *, int))
- Q_PRIVATE_SLOT(d, void displayItem(const KUrl &, const KParts::OpenUrlArguments &,
+ Q_PRIVATE_SLOT(d, void displayItem(const QUrl &, const KParts::OpenUrlArguments &,
const KParts::BrowserArguments &))
};
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index 0bde181..c70fb1e 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -28,7 +28,7 @@
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <KLocale>
-#include <KUrl>
+#include <QUrl>
#include <KGlobal>
#include <KGlobalSettings>
#include <knewstuff3/downloaddialog.h>
@@ -227,10 +227,9 @@ void MoleculeDialog::clearAllElementsInEditor()
void MoleculeDialog::slotSaveMolecule()
{
- KUrl url("kfiledialog:///kalzium");
QString commonMoleculeFormats = i18n("Common molecule formats");
QString allFiles = i18n("All files");
- QString filename = KFileDialog::getSaveFileName(url,
+ QString filename = KFileDialog::getSaveFileName(QUrl(),
"*.cml *.xyz *.ent *.pdb *.alc *.chm *.cdx *.cdxml *.c3d1 *.c3d2"
" *.gpr *.mdl *.mol *.sdf *.sd *.crk3d *.cht *.dmol *.bgf"
" *.gam *.inp *.gamin *.gamout *.tmol *.fract"
@@ -302,7 +301,7 @@ void MoleculeDialog::slotDownloadNewStuff()
kDebug() << "Changed Entry: " << entry.installedFiles();
foreach (const QString &origFile, entry.installedFiles()) {
const QString destFile = destinationDir + '/' + QFileInfo(origFile).fileName();
- KJob *job = KIO::file_move(KUrl::fromPath(origFile), KUrl::fromPath(destFile));
+ KJob *job = KIO::file_move(QUrl::fromLocalFile(origFile), QUrl::fromPath(destFile));
const bool success = job->exec();
if (success) {
if (exactlyOneFile.isEmpty()) {
diff --git a/src/tools/obconverter.cpp b/src/tools/obconverter.cpp
index 8e46249..c622eab 100644
--- a/src/tools/obconverter.cpp
+++ b/src/tools/obconverter.cpp
@@ -36,7 +36,7 @@
#include <KMessageBox>
#include <KFileDialog>
#include <KLocalizedString>
-#include <KUrl>
+#include <QUrl>
#include <KDialog>
#include <kdialogbuttonbox.h>
using namespace std;
@@ -123,13 +123,13 @@ void KOpenBabel::slotAddFile()
// "*.acr|ACR format [Read-only]", "*.alc|Alchemy format" //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- KUrl::List fl = KFileDialog::getOpenUrls(
- KUrl(),
+ QList<QUrl> fl = KFileDialog::getOpenUrls(
+ QUrl(),
"*|" +i18n("All Files") + '\n' + tmpList.join("\n") //add all possible extensions like "*.cml *.mol"
);
- foreach (const KUrl& u , fl) {
- new QListWidgetItem(u.prettyUrl(), ui.FileListView);
+ foreach (const QUrl &u , fl) {
+ new QListWidgetItem(u.toDisplayString(), ui.FileListView);
}
}
@@ -198,7 +198,7 @@ void KOpenBabel::slotConvert()
QStringList cmdList; // Full command
QLinkedList<QStringList> cmdArgList; // Arguments only
foreach (QListWidgetItem * item, p) {
- QString ifname = KUrl(item->text()).toLocalFile();
+ QString ifname = QUrl(item->text()).toLocalFile();
QString ofname = ifname;
ofname = ofname.remove(QRegExp("\\.([^\\.]*$)"));
ofname = ofname + QLatin1String(".") + oformat;