summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohan Garg <rohan16garg@gmail.com>2014-08-13 20:57:48 (GMT)
committerRohan Garg <rohan16garg@gmail.com>2014-08-13 21:03:23 (GMT)
commitbd36521c3631f50002613ac73c59178f57896f39 (patch)
treee2872e2167d6b9becee5db0af026d10d77d9f934
parentd5b9a2e07809f665b4c7b6615ba8c1e827a29025 (diff)
Port away from KUrl, pretify headers
-rw-r--r--shell/shell.cpp48
-rw-r--r--shell/shellutils.cpp15
-rw-r--r--shell/shellutils.h6
3 files changed, 32 insertions, 37 deletions
diff --git a/shell/shell.cpp b/shell/shell.cpp
index c0693f4..010db97 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -20,35 +20,29 @@
#include "shell.h"
// qt/kde includes
-#include <qdesktopwidget.h>
-#include <qtimer.h>
-#include <QtDBus/qdbusconnection.h>
-#include <kaction.h>
-#include <kapplication.h>
-#include <kcmdlineargs.h>
-#include <kfiledialog.h>
-#include <kpluginloader.h>
-#include <kmessagebox.h>
-#include <kmimetype.h>
-#include <kstandardaction.h>
-#include <ktoolbar.h>
-#include <kdebug.h>
-#include <klocale.h>
-#include <kmenubar.h>
-#include <kio/netaccess.h>
-#include <krecentfilesaction.h>
-#include <kservicetypetrader.h>
-#include <ktoggleaction.h>
-#include <ktogglefullscreenaction.h>
-#include <kactioncollection.h>
-#include <kwindowsystem.h>
-#include <ktabwidget.h>
-#include <kxmlguifactory.h>
+#include <QDesktopWidget>
+#include <QTimer>
+#include <QDBusConnection>
+#include <QMenuBar>
+#include <QApplication>
+
+#include <KFileDialog>
+#include <KPluginLoader>
+#include <KMessageBox>
+#include <KMimeType>
+#include <KStandardAction>
+#include <KToolBar>
+#include <KRecentFilesAction>
+#include <KServiceTypeTrader>
+#include <KToggleFullScreenAction>
+#include <KActionCollection>
+#include <KWindowSystem>
+#include <KTabWidget>
+#include <KXMLGUIFactory>
#include <QDragMoveEvent>
#include <QTabBar>
-#include <kicon.h>
-#include <kglobal.h>
-#include <kconfiggroup.h>
+#include <KGlobal>
+#include <KConfigGroup>
#include <KUrlMimeData>
#ifdef KActivities_FOUND
diff --git a/shell/shellutils.cpp b/shell/shellutils.cpp
index 26c6825..7d8a5a5 100644
--- a/shell/shellutils.cpp
+++ b/shell/shellutils.cpp
@@ -10,9 +10,10 @@
#include "shellutils.h"
// qt/kde includes
-#include <qfile.h>
-#include <qregexp.h>
-#include <kcmdlineargs.h>
+#include <QUrl>
+#include <QFile>
+#include <QRegExp>
+#include <KCmdLineArgs>
namespace ShellUtils
{
@@ -32,7 +33,7 @@ FileExistFunc qfileExistFunc()
return detail::qfileExistFunc;
}
-KUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& pageArg )
+QUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& pageArg )
{
/*
Rationale for the small "cut-and-paste" work being done below:
@@ -46,7 +47,7 @@ KUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& p
{
arg = QString::fromUtf8( QByteArray::fromPercentEncoding( arg.toUtf8() ) );
}
- KUrl url = KCmdLineArgs::makeURL( arg.toUtf8() );
+ QUrl url = KCmdLineArgs::makeURL( arg.toUtf8() );
int sharpPos = -1;
if ( !url.isLocalFile() || !exist_func( url.toLocalFile() ) )
{
@@ -55,11 +56,11 @@ KUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& p
if ( sharpPos != -1 )
{
url = KCmdLineArgs::makeURL( arg.left( sharpPos ).toUtf8() );
- url.setHTMLRef( arg.mid( sharpPos + 1 ) );
+ url.setFragment( arg.mid( sharpPos + 1 ) );
}
else if ( !pageArg.isEmpty() )
{
- url.setHTMLRef( pageArg );
+ url.setFragment( pageArg );
}
return url;
}
diff --git a/shell/shellutils.h b/shell/shellutils.h
index 6c0c228..ef2ef98 100644
--- a/shell/shellutils.h
+++ b/shell/shellutils.h
@@ -10,9 +10,9 @@
#ifndef OKULAR_SHELLUTILS_H
#define OKULAR_SHELLUTILS_H
-#include <qstring.h>
+#include <QString>
-#include <kurl.h>
+class QUrl;
namespace ShellUtils
{
@@ -20,7 +20,7 @@ namespace ShellUtils
typedef bool (*FileExistFunc)( const QString& fileName );
FileExistFunc qfileExistFunc();
-KUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& pageArg = QString() );
+QUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& pageArg = QString() );
}