Commit 08ab3c35 authored by Rahul Chowdhury's avatar Rahul Chowdhury
Browse files

Port KUrl -> QUrl

REVIEW: 125150
parent 70825cdc
......@@ -31,7 +31,6 @@
#include <klocale.h>
#include <kdebug.h>
#include <kurl.h>
#include <kstandarddirs.h>
#include <kpixmapcache.h>
#include <QXmlReader>
......
......@@ -23,7 +23,6 @@
#include <QStringList>
#include <KLocale>
#include <KUrl>
#include <KStandardDirs>
#include <KConfigGroup>
......
......@@ -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);
......
......@@ -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();
......
......@@ -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);
......
......@@ -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>";
......
......@@ -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 &))
};
......
......@@ -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()) {
......
......@@ -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;
......
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