summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohan Garg <rohan16garg@gmail.com>2014-08-13 16:33:42 (GMT)
committerRohan Garg <rohan16garg@gmail.com>2014-08-13 21:03:23 (GMT)
commitd5b9a2e07809f665b4c7b6615ba8c1e827a29025 (patch)
tree9abb85dca089896f521a531e9e80cac18e462163
parentf8b9546afff0695d27cecb4b1e9fd74c3a862917 (diff)
Port Shell away from KUrl to QUrl
REVIEWED-BY: Albert Astals Cid <aacid@kde.org>
-rw-r--r--shell/shell.cpp13
-rw-r--r--shell/shell.h7
2 files changed, 9 insertions, 11 deletions
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 2edb6e1..c0693f4 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -32,7 +32,6 @@
#include <kmimetype.h>
#include <kstandardaction.h>
#include <ktoolbar.h>
-#include <kurl.h>
#include <kdebug.h>
#include <klocale.h>
#include <kmenubar.h>
@@ -215,7 +214,7 @@ bool Shell::canOpenDocs( int numDocs, int desktop )
return true;
}
-void Shell::openUrl( const KUrl & url )
+void Shell::openUrl( const QUrl & url )
{
const int activeTab = m_tabWidget->currentIndex();
if ( activeTab < m_tabs.size() )
@@ -253,7 +252,7 @@ void Shell::openUrl( const KUrl & url )
QMetaObject::invokeMethod( activePart, "enableStartWithPrint" );
}
bool openOk = activePart->openUrl( url );
- const bool isstdin = url.fileName( KUrl::ObeyTrailingSlash ) == QLatin1String( "-" );
+ const bool isstdin = url.fileName() == QLatin1String( "-" );
if ( !isstdin )
{
if ( openOk )
@@ -310,7 +309,7 @@ void Shell::writeSettings()
void Shell::setupActions()
{
KStandardAction::open(this, SLOT(fileOpen()), actionCollection());
- m_recent = KStandardAction::openRecent( this, SLOT(openUrl(KUrl)), actionCollection() );
+ m_recent = KStandardAction::openRecent( this, SLOT(openUrl(QUrl)), actionCollection() );
m_recent->setToolBarMode( KRecentFilesAction::MenuMode );
connect( m_recent, SIGNAL(triggered()), this, SLOT(showOpenRecentMenu()) );
m_recent->setToolTip( i18n("Click to open a file\nClick and hold to open a recent file") );
@@ -413,7 +412,7 @@ void Shell::fileOpen()
dlg.setWindowTitle( i18n( "Open Document" ) );
if ( !dlg.exec() )
return;
- KUrl url = dlg.selectedUrl();
+ QUrl url = dlg.selectedUrl();
if ( !url.isEmpty() )
{
openUrl( url );
@@ -532,7 +531,7 @@ void Shell::closeTab( int tab )
}
-void Shell::openNewTab( const KUrl& url )
+void Shell::openNewTab( const QUrl& url )
{
// Tabs are hidden when there's only one, so show it
if( m_tabs.size() == 1 )
@@ -638,7 +637,7 @@ int Shell::findTabIndex( QObject* sender )
void Shell::handleDroppedUrls( const QList<QUrl>& urls )
{
- foreach( const KUrl& url, urls )
+ foreach( const QUrl& url, urls )
{
openUrl( url );
}
diff --git a/shell/shell.h b/shell/shell.h
index 8e80ffb..62674f1 100644
--- a/shell/shell.h
+++ b/shell/shell.h
@@ -19,7 +19,6 @@
#include <kparts/mainwindow.h>
#include <kparts/readwritepart.h>
#include <kmimetype.h>
-#include <kurl.h>
#include <kaction.h>
#include <QtDBus/QtDBus>
@@ -95,7 +94,7 @@ private slots:
void slotUpdateFullScreen();
void slotShowMenubar();
- void openUrl( const KUrl & url );
+ void openUrl( const QUrl & url );
void delayedOpen();
void showOpenRecentMenu();
void closeUrl();
@@ -123,7 +122,7 @@ private:
void setupActions();
void init();
QStringList fileFormats() const;
- void openNewTab( const KUrl& url );
+ void openNewTab( const QUrl& url );
void connectPart( QObject* part );
int findTabIndex( QObject* sender );
@@ -139,7 +138,7 @@ private:
KToggleAction* m_showMenuBarAction;
bool m_menuBarWasShown, m_toolBarWasShown;
bool m_unique;
- KUrl m_openUrl;
+ QUrl m_openUrl;
KTabWidget* m_tabWidget;
KToggleAction* m_openInTab;