summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-10-30 20:40:02 +0100
committerMontel Laurent <[email protected]>2014-10-30 20:40:02 +0100
commitefe61f237273bc4deafcd535c05ffabc5e39108f (patch)
treee99bcd98500f45827ecc57af860d572f76661aee
parent0051463bfe86624843d149412eaaf761c2de619a (diff)
Port to qDebug
-rw-r--r--app/batchextract.cpp14
-rw-r--r--app/extractHereDndPlugin.cpp10
-rw-r--r--app/main.cpp12
-rw-r--r--app/mainwindow.cpp14
-rw-r--r--part/archivemodel.cpp30
-rw-r--r--part/archiveview.cpp10
-rw-r--r--part/arkviewer.cpp8
-rw-r--r--part/jobtracker.cpp2
-rw-r--r--part/part.cpp10
9 files changed, 55 insertions, 55 deletions
diff --git a/app/batchextract.cpp b/app/batchextract.cpp
index 6772508..d95d8b6 100644
--- a/app/batchextract.cpp
+++ b/app/batchextract.cpp
@@ -33,7 +33,7 @@
#include "kerfuffle/jobs.h"
#include "kerfuffle/queries.h"
-#include <KDebug>
+#include <QDebug>
#include <KLocalizedString>
#include <KMessageBox>
#include <KRun>
@@ -85,7 +85,7 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive)
Kerfuffle::ExtractJob *job = archive->copyFiles(QVariantList(), destination, options);
- kDebug() << QString(QLatin1String( "Registering job from archive %1, to %2, preservePaths %3" )).arg(archive->fileName()).arg(destination).arg(preservePaths());
+ //qDebug() << QString(QLatin1String( "Registering job from archive %1, to %2, preservePaths %3" )).arg(archive->fileName()).arg(destination).arg(preservePaths());
addSubjob(job);
@@ -139,7 +139,7 @@ void BatchExtract::slotStartJob()
m_initialJobCount = subjobs().size();
- kDebug() << "Starting first job";
+ //qDebug() << "Starting first job";
subjobs().at(0)->start();
}
@@ -153,12 +153,12 @@ void BatchExtract::showFailedFiles()
void BatchExtract::slotResult(KJob *job)
{
- kDebug();
+ //qDebug();
// TODO: The user must be informed about which file caused the error, and that the other files
// in the queue will not be extracted.
if (job->error()) {
- kDebug() << "There was en error, " << job->errorText();
+ //qDebug() << "There was en error, " << job->errorText();
setErrorText(job->errorText());
setError(job->error());
@@ -183,10 +183,10 @@ void BatchExtract::slotResult(KJob *job)
KRun::runUrl(destination, QLatin1String( "inode/directory" ), 0);
}
- kDebug() << "Finished, emitting the result";
+ //qDebug() << "Finished, emitting the result";
emitResult();
} else {
- kDebug() << "Starting the next job";
+ //qDebug() << "Starting the next job";
emit description(this,
i18n("Extracting file..."),
qMakePair(i18n("Source archive"), m_fileNames.value(subjobs().at(0)).first),
diff --git a/app/extractHereDndPlugin.cpp b/app/extractHereDndPlugin.cpp
index cf08a33..826b927 100644
--- a/app/extractHereDndPlugin.cpp
+++ b/app/extractHereDndPlugin.cpp
@@ -24,7 +24,7 @@
#include "kerfuffle/archive.h"
#include <KAction>
-#include <KDebug>
+#include <QDebug>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KLocale>
@@ -37,7 +37,7 @@ K_EXPORT_PLUGIN(ExtractHerePluginFactory("stupidname", "ark"))
void ExtractHereDndPlugin::slotTriggered()
{
- kDebug() << "Preparing job";
+ //qDebug() << "Preparing job";
BatchExtract *batchJob = new BatchExtract();
batchJob->setAutoSubfolder(true);
@@ -48,7 +48,7 @@ void ExtractHereDndPlugin::slotTriggered()
}
batchJob->start();
- kDebug() << "Started job";
+ //qDebug() << "Started job";
}
@@ -64,11 +64,11 @@ void ExtractHereDndPlugin::setup(const KFileItemListProperties& popupMenuInfo,
const QString extractHereMessage = i18nc("@action:inmenu Context menu shown when an archive is being drag'n'dropped", "Extract here");
if (!Kerfuffle::supportedMimeTypes().contains(popupMenuInfo.mimeType())) {
- kDebug() << popupMenuInfo.mimeType() << "is not a supported mimetype";
+ //qDebug() << popupMenuInfo.mimeType() << "is not a supported mimetype";
return;
}
- kDebug() << "Plugin executed";
+ //qDebug() << "Plugin executed";
KAction *action = new KAction(KIcon(QLatin1String("archive-extract")),
extractHereMessage, NULL);
diff --git a/app/main.cpp b/app/main.cpp
index 626dc5e..7272014 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -27,7 +27,7 @@
#include <K4AboutData>
#include <KApplication>
#include <KCmdLineArgs>
-#include <KDebug>
+#include <QDebug>
#include <KLocale>
#include <QByteArray>
@@ -170,18 +170,18 @@ int main(int argc, char **argv)
}
if (args->isSet("autosubfolder")) {
- kDebug() << "Setting autosubfolder";
+ //qDebug() << "Setting autosubfolder";
batchJob->setAutoSubfolder(true);
}
if (args->isSet("autodestination")) {
QString autopath = QFileInfo(args->url(0).path()).path();
- kDebug() << "By autodestination, setting path to " << autopath;
+ //qDebug() << "By autodestination, setting path to " << autopath;
batchJob->setDestinationFolder(autopath);
}
if (args->isSet("destination")) {
- kDebug() << "Setting destination to " << args->getOption("destination");
+ //qDebug() << "Setting destination to " << args->getOption("destination");
batchJob->setDestinationFolder(args->getOption("destination"));
}
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
}
if (args->count()) {
- kDebug() << "trying to open" << args->url(0);
+ //qDebug() << "trying to open" << args->url(0);
if (args->isSet("dialog")) {
window->setShowExtractDialog(true);
@@ -210,6 +210,6 @@ int main(int argc, char **argv)
}
}
- kDebug() << "Entering application loop";
+ //qDebug() << "Entering application loop";
return application.exec();
}
diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index dc4105b..af98237 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -32,7 +32,7 @@
#include <KActionCollection>
#include <KStandardAction>
#include <KRecentFilesAction>
-#include <KDebug>
+#include <QDebug>
#include <KEditToolBar>
#include <KShortcutsDialog>
#include <KService>
@@ -76,7 +76,7 @@ MainWindow::~MainWindow()
void MainWindow::dragEnterEvent(QDragEnterEvent * event)
{
- kDebug() << event;
+ //qDebug() << event;
Interface *iface = qobject_cast<Interface*>(m_part);
if (iface->isBusy()) {
@@ -91,7 +91,7 @@ void MainWindow::dragEnterEvent(QDragEnterEvent * event)
void MainWindow::dropEvent(QDropEvent * event)
{
- kDebug() << event;
+ //qDebug() << event;
Interface *iface = qobject_cast<Interface*>(m_part);
if (iface->isBusy()) {
@@ -110,7 +110,7 @@ void MainWindow::dropEvent(QDropEvent * event)
void MainWindow::dragMoveEvent(QDragMoveEvent * event)
{
- kDebug() << event;
+ //qDebug() << event;
Interface *iface = qobject_cast<Interface*>(m_part);
if (iface->isBusy()) {
@@ -132,7 +132,7 @@ bool MainWindow::loadPart()
// }
// if (!factory || !m_part) {
// KMessageBox::error(this, i18n("Unable to find Ark's KPart component, please check your installation."));
-// kWarning() << "Error loading Ark KPart: " << loader.errorString();
+// qWarning() << "Error loading Ark KPart: " << loader.errorString();
// return false;
// }
@@ -147,7 +147,7 @@ bool MainWindow::loadPart()
if (!m_part) {
KMessageBox::error(this, i18n("Unable to find Ark's KPart component, please check your installation."));
- kWarning() << "Error loading Ark KPart: ";
+ qWarning() << "Error loading Ark KPart: ";
return false;
}
@@ -265,7 +265,7 @@ void MainWindow::newArchive()
const QStringList mimeTypes = Kerfuffle::supportedWriteMimeTypes();
- kDebug() << "Supported mimetypes are" << mimeTypes.join( QLatin1String( " " ));
+ //qDebug() << "Supported mimetypes are" << mimeTypes.join( QLatin1String( " " ));
QFileDialog dlg(this);
dlg.setMimeTypeFilters(mimeTypes);
diff --git a/part/archivemodel.cpp b/part/archivemodel.cpp
index 92a4ba0..6ebbe07 100644
--- a/part/archivemodel.cpp
+++ b/part/archivemodel.cpp
@@ -25,7 +25,7 @@
#include "kerfuffle/archive.h"
#include "kerfuffle/jobs.h"
-#include <KDebug>
+#include <QDebug>
#include <KIconLoader>
#include <KLocalizedString>
#include <KIO/NetAccess>
@@ -382,8 +382,8 @@ QVariant ArchiveModel::headerData(int section, Qt::Orientation, int role) const
{
if (role == Qt::DisplayRole) {
if (section >= m_showColumns.size()) {
- kDebug() << "WEIRD: showColumns.size = " << m_showColumns.size()
- << " and section = " << section;
+ //qDebug() << "WEIRD: showColumns.size = " << m_showColumns.size()
+ // << " and section = " << section;
return QVariant();
}
@@ -603,14 +603,14 @@ bool ArchiveModel::dropMimeData(const QMimeData * data, Qt::DropAction action, i
if (parent.isValid()) {
QModelIndex droppedOnto = index(row, column, parent);
if (entryForIndex(droppedOnto).value(IsDirectory).toBool()) {
- kDebug() << "Using entry";
+ //qDebug() << "Using entry";
path = entryForIndex(droppedOnto).value(FileName).toString();
} else {
path = entryForIndex(parent).value(FileName).toString();
}
}
- kDebug() << "Dropped onto " << path;
+ //qDebug() << "Dropped onto " << path;
#endif
@@ -701,7 +701,7 @@ QModelIndex ArchiveModel::indexForNode(ArchiveNode *node)
void ArchiveModel::slotEntryRemoved(const QString & path)
{
- kDebug() << "Removed node at path " << path;
+ //qDebug() << "Removed node at path " << path;
const QString entryFileName(cleanFileName(path));
if (entryFileName.isEmpty()) {
@@ -721,7 +721,7 @@ void ArchiveModel::slotEntryRemoved(const QString & path)
endRemoveRows();
} else {
- kDebug() << "Did not find the removed node";
+ //qDebug() << "Did not find the removed node";
}
}
@@ -747,7 +747,7 @@ void ArchiveModel::slotNewEntry(const ArchiveEntry& entry)
void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour behaviour)
{
if (receivedEntry[FileName].toString().isEmpty()) {
- kDebug() << "Weird, received empty entry (no filename) - skipping";
+ //qDebug() << "Weird, received empty entry (no filename) - skipping";
return;
}
@@ -781,7 +781,7 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
m_showColumns << toInsert;
endInsertColumns();
- kDebug() << "Show columns detected: " << m_showColumns;
+ //qDebug() << "Show columns detected: " << m_showColumns;
}
//make a copy
@@ -799,7 +799,7 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
if (m_rootNode) {
ArchiveNode *existing = m_rootNode->findByPath(entry[ FileName ].toString().split(QLatin1Char( '/' )));
if (existing) {
- kDebug() << "Refreshing entry for" << entry[FileName].toString();
+ //qDebug() << "Refreshing entry for" << entry[FileName].toString();
// Multi-volume files are repeated at least in RAR archives.
// In that case, we need to sum the compressed size for each volume
@@ -832,7 +832,7 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
void ArchiveModel::slotLoadingFinished(KJob *job)
{
- //kDebug() << entry;
+ ////qDebug() << entry;
foreach(const ArchiveEntry &entry, m_newArchiveEntries) {
newEntry(entry, DoNotNotifyViews);
}
@@ -939,7 +939,7 @@ DeleteJob* ArchiveModel::deleteFiles(const QList<QVariant> & files)
void ArchiveModel::slotCleanupEmptyDirs()
{
- kDebug();
+ //qDebug();
QList<QPersistentModelIndex> queue;
QList<QPersistentModelIndex> nodesToDelete;
@@ -952,7 +952,7 @@ void ArchiveModel::slotCleanupEmptyDirs()
while (!queue.isEmpty()) {
QPersistentModelIndex node = queue.takeFirst();
ArchiveEntry entry = entryForIndex(node);
- //kDebug() << "Trying " << entry[FileName].toString();
+ ////qDebug() << "Trying " << entry[FileName].toString();
if (!hasChildren(node)) {
if (!entry.contains(InternalID)) {
@@ -967,11 +967,11 @@ void ArchiveModel::slotCleanupEmptyDirs()
foreach(const QPersistentModelIndex& node, nodesToDelete) {
ArchiveNode *rawNode = static_cast<ArchiveNode*>(node.internalPointer());
- kDebug() << "Delete with parent entries " << rawNode->parent()->entries() << " and row " << rawNode->row();
+ //qDebug() << "Delete with parent entries " << rawNode->parent()->entries() << " and row " << rawNode->row();
beginRemoveRows(parent(node), rawNode->row(), rawNode->row());
rawNode->parent()->removeEntryAt(rawNode->row());
endRemoveRows();
- //kDebug() << "Removed entry " << entry[FileName].toString();
+ ////qDebug() << "Removed entry " << entry[FileName].toString();
}
}
diff --git a/part/archiveview.cpp b/part/archiveview.cpp
index 53970d5..217ecc5 100644
--- a/part/archiveview.cpp
+++ b/part/archiveview.cpp
@@ -21,7 +21,7 @@
#include "archiveview.h"
-#include <KDebug>
+#include <QDebug>
#include <QMimeData>
#include <QApplication>
@@ -36,7 +36,7 @@ ArchiveView::ArchiveView(QWidget *parent)
void ArchiveView::setModel(QAbstractItemModel *model)
{
- kDebug();
+ //qDebug();
QTreeView::setModel(model);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -60,7 +60,7 @@ void ArchiveView::startDrag(Qt::DropActions supportedActions)
return;
}
- kDebug() << "Singling out the current selection...";
+ //qDebug() << "Singling out the current selection...";
selectionModel()->setCurrentIndex(currentIndex(), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
QTreeView::startDrag(supportedActions);
}
@@ -69,7 +69,7 @@ void ArchiveView::startDrag(Qt::DropActions supportedActions)
void ArchiveView::dragEnterEvent(QDragEnterEvent * event)
{
//TODO: if no model, trigger some mechanism to create one automatically!
- kDebug() << event;
+ //qDebug() << event;
if (event->source() == this) {
//we don't support internal drops yet.
@@ -81,7 +81,7 @@ void ArchiveView::dragEnterEvent(QDragEnterEvent * event)
void ArchiveView::dropEvent(QDropEvent * event)
{
- kDebug() << event;
+ //qDebug() << event;
if (event->source() == this) {
//we don't support internal drops yet.
diff --git a/part/arkviewer.cpp b/part/arkviewer.cpp
index f560c36..aad43de 100644
--- a/part/arkviewer.cpp
+++ b/part/arkviewer.cpp
@@ -23,7 +23,7 @@
#include <KLocalizedString>
#include <KMimeTypeTrader>
-#include <KDebug>
+#include <QDebug>
#include <KIconLoader>
#include <KVBox>
#include <KMessageBox>
@@ -90,7 +90,7 @@ void ArkViewer::view(const QString& fileName, QWidget *parent)
{
QMimeDatabase db;
QMimeType mimeType = db.mimeTypeForFile(fileName);
- kDebug() << "MIME type" << mimeType.name();
+ //qDebug() << "MIME type" << mimeType.name();
KService::Ptr viewer = ArkViewer::getViewer(mimeType.name());
const bool needsExternalViewer = (!viewer &&
@@ -226,7 +226,7 @@ bool ArkViewer::viewInInternalViewer(const QString& fileName, const QMimeType &m
// maybe there should be an option controlling this
KHTMLPart *khtmlPart = qobject_cast<KHTMLPart*>(m_part.data());
if (khtmlPart) {
- kDebug() << "Disabling javascripts, plugins, java and external references for KHTMLPart";
+ //qDebug() << "Disabling javascripts, plugins, java and external references for KHTMLPart";
khtmlPart->setJScriptEnabled(false);
khtmlPart->setJavaEnabled(false);
khtmlPart->setPluginsEnabled(false);
@@ -241,7 +241,7 @@ bool ArkViewer::viewInInternalViewer(const QString& fileName, const QMimeType &m
void ArkViewer::slotOpenUrlRequestDelayed(const QUrl& url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments& browserArguments)
{
- kDebug() << "Opening URL: " << url;
+ //qDebug() << "Opening URL: " << url;
Q_UNUSED(arguments)
Q_UNUSED(browserArguments)
diff --git a/part/jobtracker.cpp b/part/jobtracker.cpp
index 38cbb9a..8ee1f72 100644
--- a/part/jobtracker.cpp
+++ b/part/jobtracker.cpp
@@ -21,7 +21,7 @@
*/
#include "jobtracker.h"
-#include <KDebug>
+#include <QDebug>
JobTrackerWidget::JobTrackerWidget(QWidget *parent)
: QFrame(parent)
diff --git a/part/part.cpp b/part/part.cpp
index c134004..a49c60a 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -36,7 +36,7 @@
#include <K4AboutData>
#include <KActionCollection>
#include <KConfigGroup>
-#include <KDebug>
+#include <QDebug>
#include <KGuiItem>
#include <KIO/Job>
#include <KIO/NetAccess>
@@ -86,7 +86,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList& args)
const QString pathName = QStringLiteral("/DndExtract/%1").arg(s_instanceCounter++);
if (!QDBusConnection::sessionBus().registerObject(pathName, this)) {
- kFatal() << "Could not register a D-Bus object for drag'n'drop";
+ qCritical() << "Could not register a D-Bus object for drag'n'drop";
}
m_model = new ArchiveModel(pathName, this);
@@ -156,7 +156,7 @@ void Part::registerJob(KJob* job)
// See bugs #189322 and #204323.
void Part::extractSelectedFilesTo(const QString& localPath)
{
- kDebug() << "Extract to " << localPath;
+ //qDebug() << "Extract to " << localPath;
if (!m_model) {
return;
}
@@ -169,7 +169,7 @@ void Part::extractSelectedFilesTo(const QString& localPath)
}
QVariant internalRoot;
- kDebug() << "valid " << m_view->currentIndex().parent().isValid();
+ //qDebug() << "valid " << m_view->currentIndex().parent().isValid();
if (m_view->currentIndex().parent().isValid()) {
internalRoot = m_model->entryForIndex(m_view->currentIndex().parent()).value(InternalID);
}
@@ -188,7 +188,7 @@ void Part::extractSelectedFilesTo(const QString& localPath)
return;
}
- kDebug() << "selected files are " << files;
+ //qDebug() << "selected files are " << files;
Kerfuffle::ExtractionOptions options;
options[QLatin1String( "PreservePaths" )] = true;
if (!internalRoot.isNull()) {