summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Feck <[email protected]>2014-12-20 23:53:51 +0100
committerChristoph Feck <[email protected]>2014-12-20 23:53:51 +0100
commit21d9feaa784d8de4893967fdc7a0c09b1674f920 (patch)
treea3b0c8c87723690d538532ee23392b01d55d60d5
parent62445a788b59d5a90dd7d3efa8c965123f3e50f7 (diff)
KUrl::List -> QList<QUrl>
-rw-r--r--src/lib/logFile.cpp6
-rw-r--r--src/lib/logFile.h7
-rw-r--r--src/lib/logManager.cpp4
-rw-r--r--src/lib/logManager.h2
-rw-r--r--src/lib/view.cpp9
-rw-r--r--src/lib/view.h2
-rw-r--r--src/modes/base/fileList.cpp4
-rw-r--r--src/modes/base/fileListHelper.cpp14
-rw-r--r--src/modes/base/fileListHelper.h13
-rw-r--r--src/modes/base/genericConfiguration.cpp2
-rw-r--r--src/modes/base/logLevelFileList.cpp2
-rw-r--r--src/modes/base/multipleFileList.cpp4
12 files changed, 34 insertions, 35 deletions
diff --git a/src/lib/logFile.cpp b/src/lib/logFile.cpp
index df92496..fc329f1 100644
--- a/src/lib/logFile.cpp
+++ b/src/lib/logFile.cpp
@@ -27,7 +27,7 @@
class LogFilePrivate {
public:
- KUrl url;
+ QUrl url;
LogLevel* defaultLogLevel;
@@ -46,7 +46,7 @@ LogFile::LogFile(const LogFile& logFile) :
d->defaultLogLevel = logFile.defaultLogLevel();
}
-LogFile::LogFile(const KUrl& url, LogLevel* defaultLogLevel) :
+LogFile::LogFile(const QUrl& url, LogLevel* defaultLogLevel) :
d(new LogFilePrivate()) {
d->url = url;
@@ -73,7 +73,7 @@ LogFile& LogFile::operator=(const LogFile& logFile) {
return *this;
}
-KUrl LogFile::url() const {
+QUrl LogFile::url() const {
return d->url;
}
diff --git a/src/lib/logFile.h b/src/lib/logFile.h
index c7bfa8d..7d52e2a 100644
--- a/src/lib/logFile.h
+++ b/src/lib/logFile.h
@@ -25,8 +25,7 @@
#include <QObject>
#include <QDataStream>
#include <QDebug>
-
-#include <kurl.h>
+#include <QUrl>
class LogLevel;
@@ -40,7 +39,7 @@ class LogFile : public QObject {
LogFile();
LogFile(const LogFile& logFile);
- LogFile(const KUrl& url, LogLevel* defaultLogLevel);
+ LogFile(const QUrl& url, LogLevel* defaultLogLevel);
virtual ~LogFile();
@@ -48,7 +47,7 @@ class LogFile : public QObject {
LogFile& operator=(const LogFile& column);
- KUrl url() const;
+ QUrl url() const;
LogLevel* defaultLogLevel() const;
diff --git a/src/lib/logManager.cpp b/src/lib/logManager.cpp
index 4e35373..41988b6 100644
--- a/src/lib/logManager.cpp
+++ b/src/lib/logManager.cpp
@@ -55,7 +55,7 @@ LogManager::LogManager(View* view) :
d->analyzer = NULL;
d->usedView = view;
- connect(d->usedView, SIGNAL(droppedUrls(KUrl::List)), this, SLOT(loadDroppedUrls(KUrl::List)));
+ connect(d->usedView, SIGNAL(droppedUrls(QList<QUrl>)), this, SLOT(loadDroppedUrls(QList<QUrl>)));
}
LogManager::~LogManager() {
@@ -199,7 +199,7 @@ bool LogManager::isParsingPaused() const {
return d->analyzer->isParsingPaused();
}
-void LogManager::loadDroppedUrls(const KUrl::List& urls) {
+void LogManager::loadDroppedUrls(const QList<QUrl>& urls) {
logDebug() << "Drop " << urls << endl;
QList<LogFile> logFiles;
diff --git a/src/lib/logManager.h b/src/lib/logManager.h
index f68a318..4a482c3 100644
--- a/src/lib/logManager.h
+++ b/src/lib/logManager.h
@@ -77,7 +77,7 @@ class LogManager : public QObject {
void logUpdated(View* view, int addedLines);
private slots:
- void loadDroppedUrls(const KUrl::List& urls);
+ void loadDroppedUrls(const QList<QUrl>& urls);
private:
void internalInitialize(LogMode* mode, const QList<LogFile>& logFiles);
diff --git a/src/lib/view.cpp b/src/lib/view.cpp
index c3d9166..fa5db13 100644
--- a/src/lib/view.cpp
+++ b/src/lib/view.cpp
@@ -26,6 +26,7 @@
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QFileInfo>
+#include <QMimeData>
#include <QPushButton>
@@ -188,7 +189,7 @@ QSize View::sizeHint() const {
}
void View::dropEvent(QDropEvent* event) {
- KUrl::List urls = KUrl::List::fromMimeData( event->mimeData() );
+ QList<QUrl> urls = event->mimeData()->urls();
//If URLs have been dropped
if ( ! urls.isEmpty() ) {
@@ -198,7 +199,7 @@ void View::dropEvent(QDropEvent* event) {
}
void View::dragEnterEvent(QDragEnterEvent* event) {
- KUrl::List urls = KUrl::List::fromMimeData( event->mimeData() );
+ QList<QUrl> urls = event->mimeData()->urls();
//If URLs have been dropped
if (urls.isEmpty() ) {
@@ -206,8 +207,8 @@ void View::dragEnterEvent(QDragEnterEvent* event) {
return;
}
- foreach (const KUrl &url, urls) {
- QFileInfo fileInfo(url.path());
+ foreach (const QUrl &url, urls) {
+ QFileInfo fileInfo(url.toLocalFile());
//TODO Add a recognition of binary files (using the Url mimetype) and refuse them
diff --git a/src/lib/view.h b/src/lib/view.h
index 7e3672f..913f30a 100644
--- a/src/lib/view.h
+++ b/src/lib/view.h
@@ -81,7 +81,7 @@ class View : public QWidget {
signals:
void searchFilterChanged();
- void droppedUrls(const KUrl::List& urls);
+ void droppedUrls(const QList<QUrl>& urls);
private:
ViewPrivate* const d;
diff --git a/src/modes/base/fileList.cpp b/src/modes/base/fileList.cpp
index 10aab00..be42a8e 100644
--- a/src/modes/base/fileList.cpp
+++ b/src/modes/base/fileList.cpp
@@ -89,7 +89,7 @@ bool FileList::isEmpty() const {
void FileList::addItem() {
//Open a standard Filedialog
- KUrl::List urls=fileListHelper.openUrls();
+ QList<QUrl> urls=fileListHelper.openUrls();
QStringList paths=fileListHelper.findPaths(urls);
foreach(const QString &path, paths) {
@@ -109,7 +109,7 @@ void FileList::modifyItem(QListWidgetItem* item) {
//Open a standard Filedialog
KUrl url=fileListHelper.openUrl(previousPath);
- KUrl::List urls;
+ QList<QUrl> urls;
urls.append(url);
QStringList paths=fileListHelper.findPaths(urls);
diff --git a/src/modes/base/fileListHelper.cpp b/src/modes/base/fileListHelper.cpp
index 3f481a0..6ca4e8e 100644
--- a/src/modes/base/fileListHelper.cpp
+++ b/src/modes/base/fileListHelper.cpp
@@ -75,11 +75,11 @@ void FileListHelper::prepareButton(QPushButton* button, const QIcon& icon, const
fileList->addAction(action);
}
-QStringList FileListHelper::findPaths(KUrl::List urls) {
+QStringList FileListHelper::findPaths(QList<QUrl> urls) {
QStringList paths;
- for (KUrl::List::ConstIterator it=urls.constBegin(); it!=urls.constEnd(); ++it) {
- KUrl url(*it);
+ for (QList<QUrl>::ConstIterator it=urls.constBegin(); it!=urls.constEnd(); ++it) {
+ QUrl url(*it);
if (isValidFile(url)) {
@@ -100,7 +100,7 @@ QStringList FileListHelper::findPaths(KUrl::List urls) {
return paths;
}
-bool FileListHelper::isValidFile(const KUrl& url) {
+bool FileListHelper::isValidFile(const QUrl& url) {
QString message;
//If it is not valid
@@ -123,7 +123,7 @@ bool FileListHelper::isValidFile(const KUrl& url) {
return true;
}
-KUrl::List FileListHelper::openUrls() {
+QList<QUrl> FileListHelper::openUrls() {
KFileDialog fileDialog(KUrl(DEFAULT_LOG_FOLDER), QLatin1String( "*|" ) + i18n("All Files (*)") + QLatin1String( "\n*.log|" ) + i18n("Log Files (*.log)"), parent);
fileDialog.setWindowTitle(i18n("Choose Log File"));
fileDialog.setMode(KFile::Files);
@@ -132,7 +132,7 @@ KUrl::List FileListHelper::openUrls() {
return fileDialog.selectedUrls();
}
-KUrl FileListHelper::openUrl(const QString& originPath) {
+QUrl FileListHelper::openUrl(const QString& originPath) {
KFileDialog fileDialog(KUrl(originPath), QLatin1String( "*|" ) + i18n("All Files (*)") + QLatin1String( "\n*.log|" ) + i18n("Log Files (*.log)"), parent);
fileDialog.setWindowTitle(i18n("Choose Log File"));
fileDialog.setMode(KFile::File);
@@ -141,7 +141,7 @@ KUrl FileListHelper::openUrl(const QString& originPath) {
return fileDialog.selectedUrl();
}
-QStringList FileListHelper::expandJoker(const KUrl& url) {
+QStringList FileListHelper::expandJoker(const QUrl& url) {
QDir directory = QDir(url.path().left(url.path().count() - url.fileName().count()));
logDebug() << "Dir " << directory.path() << endl;
diff --git a/src/modes/base/fileListHelper.h b/src/modes/base/fileListHelper.h
index c930e42..daa5979 100644
--- a/src/modes/base/fileListHelper.h
+++ b/src/modes/base/fileListHelper.h
@@ -22,11 +22,10 @@
#ifndef _FILE_LIST_HELPER_H_
#define _FILE_LIST_HELPER_H_
+#include <QUrl>
#include <QWidget>
#include <QIcon>
-#include <kurl.h>
-
class QAction;
class QPushButton;
@@ -42,12 +41,12 @@ class FileListHelper : public QObject {
FileListHelper(QWidget* parent);
virtual ~FileListHelper();
- QStringList findPaths(KUrl::List urls);
- bool isValidFile(const KUrl& url);
- QStringList expandJoker(const KUrl& url);
+ QStringList findPaths(QList<QUrl> urls);
+ bool isValidFile(const QUrl& url);
+ QStringList expandJoker(const QUrl& url);
- KUrl::List openUrls();
- KUrl openUrl(const QString& originPath);
+ QList<QUrl> openUrls();
+ QUrl openUrl(const QString& originPath);
/**
* Change the enabled status of the button and of its QActions
diff --git a/src/modes/base/genericConfiguration.cpp b/src/modes/base/genericConfiguration.cpp
index ef1ad10..845a56f 100644
--- a/src/modes/base/genericConfiguration.cpp
+++ b/src/modes/base/genericConfiguration.cpp
@@ -95,7 +95,7 @@ QList<LogFile> GenericLogModeConfiguration::findGenericLogFiles() {
else
level=Globals::instance()->informationLogLevel();
- KUrl url(stringValue);
+ QUrl url(stringValue);
if (!url.isValid()) {
logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path()) << endl;
continue;
diff --git a/src/modes/base/logLevelFileList.cpp b/src/modes/base/logLevelFileList.cpp
index 171e3af..41cc979 100644
--- a/src/modes/base/logLevelFileList.cpp
+++ b/src/modes/base/logLevelFileList.cpp
@@ -94,7 +94,7 @@ void LogLevelFileList::insertItem(LogLevel* level, const QString& itemText) {
void LogLevelFileList::addItem() {
//Open a standard Filedialog
- KUrl::List urls=fileListHelper.openUrls();
+ QList<QUrl> urls=fileListHelper.openUrls();
QStringList paths=fileListHelper.findPaths(urls);
foreach(const QString &path, paths) {
diff --git a/src/modes/base/multipleFileList.cpp b/src/modes/base/multipleFileList.cpp
index edaaeb1..3ffddaa 100644
--- a/src/modes/base/multipleFileList.cpp
+++ b/src/modes/base/multipleFileList.cpp
@@ -204,7 +204,7 @@ void MultipleFileList::addItem(int category) {
logDebug() << "Adding item" << category << endl;
//Open a standard Filedialog
- KUrl::List urls=fileListHelper.openUrls();
+ QList<QUrl> urls=fileListHelper.openUrls();
QTreeWidgetItem* categoryItem = fileList->topLevelItem(category);
@@ -257,7 +257,7 @@ void MultipleFileList::modifyItem(QTreeWidgetItem* item) {
//Open a standard Filedialog
KUrl url=fileListHelper.openUrl(previousPath);
- KUrl::List urls;
+ QList<QUrl> urls;
urls.append(url);
QStringList paths=fileListHelper.findPaths(urls);