Commit 46cf7e46 authored by Vishesh Handa's avatar Vishesh Handa

Port away from KUrl::List

parent 077689c4
......@@ -234,9 +234,9 @@ void BookmarkManager::Private::_o_changed( const QString & groupAddress, const Q
emit q->saved();
}
KUrl::List BookmarkManager::files() const
QList<QUrl> BookmarkManager::files() const
{
KUrl::List ret;
QList<QUrl> ret;
KBookmarkGroup group = d->manager->root();
for ( KBookmark bm = group.first(); !bm.isNull(); bm = group.next( bm ) )
{
......
......@@ -39,7 +39,7 @@ class OKULAR_EXPORT BookmarkManager : public QObject
/**
* Returns the list of documents with bookmarks.
*/
KUrl::List files() const;
QList<QUrl> files() const;
/**
* Returns the list of bookmarks for the specified @p url.
......
......@@ -3666,8 +3666,8 @@ void Document::processAction( const Action * action )
KService::Ptr ptr = KMimeTypeTrader::self()->preferredService( mime->name(), "Application" );
if ( ptr )
{
KUrl::List lst;
lst.append( fileName );
QList<QUrl> lst;
lst.append( QUrl::fromLocalFile(fileName) );
KRun::run( *ptr, lst, 0 );
}
else
......
......@@ -332,7 +332,7 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW
m_sidebar = new Sidebar( parentWidget );
setWidget( m_sidebar );
connect( m_sidebar, SIGNAL(urlsDropped(KUrl::List)), SLOT(handleDroppedUrls(KUrl::List)) );
connect( m_sidebar, SIGNAL(urlsDropped(QList<QUrl>)), SLOT(handleDroppedUrls(QList<QUrl>)) );
// build the document
m_document = new Okular::Document(widget());
......@@ -989,7 +989,7 @@ void Part::openUrlFromBookmarks(const KUrl &_url)
openUrl( url );
}
void Part::handleDroppedUrls( const KUrl::List& urls )
void Part::handleDroppedUrls( const QList<QUrl>& urls )
{
if ( urls.isEmpty() )
return;
......@@ -2042,7 +2042,7 @@ void Part::slotRenameCurrentViewportBookmark()
slotRenameBookmark( m_document->viewport() );
}
void Part::slotAboutToShowContextMenu(KMenu * /*menu*/, QAction *action, QMenu *contextMenu)
void Part::slotAboutToShowContextMenu(QMenu * /*menu*/, QAction *action, QMenu *contextMenu)
{
const QList<QAction*> actions = contextMenu->findChildren<QAction*>("OkularPrivateRenameBookmarkActions");
foreach(QAction *a, actions)
......
......@@ -159,7 +159,7 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc
void viewerMenuStateChange(bool enabled);
void enableCloseAction(bool enable);
void mimeTypeChanged(KMimeType::Ptr mimeType);
void urlsDropped( const KUrl::List& urls );
void urlsDropped( const QList<QUrl>& urls );
protected:
// reimplemented from KParts::ReadWritePart
......@@ -179,7 +179,7 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc
// connected to actions
void openUrlFromDocument(const KUrl &url);
void openUrlFromBookmarks(const KUrl &url);
void handleDroppedUrls( const KUrl::List& urls );
void handleDroppedUrls( const QList<QUrl>& urls );
void slotGoToPage();
void slotHistoryBack();
void slotHistoryNext();
......
......@@ -50,6 +50,7 @@
#include <kicon.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#include <KUrlMimeData>
#ifdef KActivities_FOUND
#include <KActivities/ResourceInstance>
......@@ -562,7 +563,7 @@ void Shell::connectPart( QObject* part )
connect( part, SIGNAL(enablePrintAction(bool)), this, SLOT(setPrintEnabled(bool)));
connect( part, SIGNAL(enableCloseAction(bool)), this, SLOT(setCloseEnabled(bool)));
connect( part, SIGNAL(mimeTypeChanged(KMimeType::Ptr)), this, SLOT(setTabIcon(KMimeType::Ptr)));
connect( part, SIGNAL(urlsDropped(KUrl::List)), this, SLOT(handleDroppedUrls(KUrl::List)) );
connect( part, SIGNAL(urlsDropped(QList<QUrl>)), this, SLOT(handleDroppedUrls(QList<QUrl>)) );
}
void Shell::print()
......@@ -635,7 +636,7 @@ int Shell::findTabIndex( QObject* sender )
return -1;
}
void Shell::handleDroppedUrls( const KUrl::List& urls )
void Shell::handleDroppedUrls( const QList<QUrl>& urls )
{
foreach( const KUrl& url, urls )
{
......@@ -645,12 +646,12 @@ void Shell::handleDroppedUrls( const KUrl::List& urls )
void Shell::testTabDrop( const QDragMoveEvent* event, bool& accept )
{
accept = KUrl::List::canDecode( event->mimeData() );
accept = event->mimeData()->hasUrls();
}
void Shell::handleTabDrop( QDropEvent* event )
{
const KUrl::List list = KUrl::List::fromMimeData( event->mimeData() );
const QList<QUrl> list = KUrlMimeData::urlsFromMimeData( event->mimeData() );
handleDroppedUrls( list );
}
......
......@@ -103,7 +103,7 @@ private slots:
void setPrintEnabled( bool enabled );
void setCloseEnabled( bool enabled );
void setTabIcon( KMimeType::Ptr mimeType );
void handleDroppedUrls( const KUrl::List& urls );
void handleDroppedUrls( const QList<QUrl>& urls );
// Tab event handlers
void setActiveTab( int tab );
......
......@@ -177,7 +177,7 @@ int main(int argc, char *argv[])
QApplication app( argc, argv );
app.setApplicationName( QLatin1String("qttest") );
qRegisterMetaType<KUrl>(); /*as done by kapplication*/
qRegisterMetaType<KUrl::List>();
qRegisterMetaType<QList<QUrl>>();
Okular::PartTest test;
KGlobal::ref(); /* don't quit qeventloop after closing a mainwindow */
return QTest::qExec( &test, argc, argv );
......
......@@ -339,7 +339,7 @@ void BookmarkList::rebuildTree( bool filter )
m_currentDocumentItem = 0;
m_tree->clear();
KUrl::List urls = m_document->bookmarkManager()->files();
QList<QUrl> urls = m_document->bookmarkManager()->files();
if ( filter )
{
if ( m_document->isOpened() )
......
......@@ -24,12 +24,14 @@
#include <qscrollbar.h>
#include <qsplitter.h>
#include <qstackedwidget.h>
#include <qmimedata.h>
#include <kglobalsettings.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmenu.h>
#include <kcolorscheme.h>
#include <kurlmimedata.h>
#include "settings.h"
......@@ -756,12 +758,12 @@ void Sidebar::appearanceChanged()
void Sidebar::dragEnterEvent( QDragEnterEvent* event )
{
event->setAccepted( KUrl::List::canDecode(event->mimeData()) );
event->setAccepted( event->mimeData()->hasUrls() );
}
void Sidebar::dropEvent( QDropEvent* event )
{
const KUrl::List list = KUrl::List::fromMimeData( event->mimeData() );
const QList<QUrl> list = KUrlMimeData::urlsFromMimeData( event->mimeData() );
emit urlsDropped( list );
}
......
......@@ -43,7 +43,7 @@ class Sidebar : public QWidget
bool isCollapsed() const;
signals:
void urlsDropped( const KUrl::List& urls );
void urlsDropped( const QList<QUrl>& urls );
protected:
void dragEnterEvent( QDragEnterEvent* event );
......
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