Commit bd36521c authored by Rohan Garg's avatar Rohan Garg

Port away from KUrl, pretify headers

parent d5b9a2e0
......@@ -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
......
......@@ -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;
}
......
......@@ -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() );
}
......
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