Git commit c38724967b547bd2da52fe74295fc7e95992333c by David Faure. Committed on 31/10/2014 at 22:10. Pushed by dfaure into branch 'master'. Fix spaces in debug output Change-Id: I8aacbaf88853ee34d731439241944023160237c7 M +29 -29 src/ioslaves/trash/trashimpl.cpp http://commits.kde.org/kio/c38724967b547bd2da52fe74295fc7e95992333c diff --git a/src/ioslaves/trash/trashimpl.cpp b/src/ioslaves/trash/trashimp= l.cpp index af129f5..9c3973d 100644 --- a/src/ioslaves/trash/trashimpl.cpp +++ b/src/ioslaves/trash/trashimpl.cpp @@ -69,7 +69,7 @@ TrashImpl::TrashImpl() : if (QT_LSTAT(QFile::encodeName(QDir::homePath()), &buff) =3D=3D 0) { m_homeDevice =3D buff.st_dev; } else { - qDebug() << "Should never happen: couldn't stat $HOME " << strerro= r(errno) << endl; + qDebug() << "Should never happen: couldn't stat $HOME" << strerror= (errno); } } = @@ -138,7 +138,7 @@ bool TrashImpl::init() // $XDG_DATA_HOME/Trash, i.e. ~/.local/share/Trash by default. const QString xdgDataDir =3D QStandardPaths::writableLocation(QStandar= dPaths::GenericDataLocation) + QLatin1Char('/'); if (!QDir().mkpath(xdgDataDir)) { - qWarning() << "failed to create " << xdgDataDir; + qWarning() << "failed to create" << xdgDataDir; return false; } = @@ -158,7 +158,7 @@ bool TrashImpl::init() } m_trashDirectories.insert(0, trashDir); m_initStatus =3D InitOK; - qDebug() << "initialization OK, home trash dir: " << trashDir; + qDebug() << "initialization OK, home trash dir:" << trashDir; return true; } = @@ -185,16 +185,16 @@ void TrashImpl::migrateOldTrash() int trashId; QString fileId; if (!createInfo(srcPath, trashId, fileId)) { - qWarning() << "Trash migration: failed to create info for " <<= srcPath; + qWarning() << "Trash migration: failed to create info for" << = srcPath; allOK =3D false; } else { bool ok =3D moveToTrash(srcPath, trashId, fileId); if (!ok) { (void)deleteInfo(trashId, fileId); - qWarning() << "Trash migration: failed to create info for = " << srcPath; + qWarning() << "Trash migration: failed to create info for"= << srcPath; allOK =3D false; } else { - qDebug() << "Trash migration: moved " << srcPath; + qDebug() << "Trash migration: moved" << srcPath; } } } @@ -231,10 +231,10 @@ bool TrashImpl::createInfo(const QString &origPath, i= nt &trashId, QString &fileI // Choose destination trash trashId =3D findTrashDirectory(origPath); if (trashId < 0) { - qWarning() << "OUCH - internal error, TrashImpl::findTrashDirector= y returned " << trashId; + qWarning() << "OUCH - internal error, TrashImpl::findTrashDirector= y returned" << trashId; return false; // ### error() needed? } - qDebug() << "trashing to " << trashId; + qDebug() << "trashing to" << trashId; = // Grab original filename QUrl url =3D QUrl::fromLocalFile(origPath); @@ -248,7 +248,7 @@ bool TrashImpl::createInfo(const QString &origPath, int= &trashId, QString &fileI int fd =3D 0; QString fileName; do { - qDebug() << "trying to create " << url.path(); + qDebug() << "trying to create" << url.path(); fd =3D ::open(QFile::encodeName(url.path()), O_WRONLY | O_CREAT | = O_EXCL, 0600); if (fd < 0) { if (errno =3D=3D EEXIST) { @@ -300,7 +300,7 @@ bool TrashImpl::createInfo(const QString &origPath, int= &trashId, QString &fileI = ::fclose(file); = - qDebug() << "info file created in trashId=3D" << trashId << " : " << f= ileId; + qDebug() << "info file created in trashId=3D" << trashId << ":" << fil= eId; return true; } = @@ -320,7 +320,7 @@ QString TrashImpl::makeRelativePath(const QString &topd= ir, const QString &path) Q_ASSERT(rel[0] !=3D QLatin1Char('/')); return rel; } else { // shouldn't happen... - qWarning() << "Couldn't make relative path for " << realPath << " = (" << path << "), with topdir=3D" << topdir; + qWarning() << "Couldn't make relative path for" << realPath << "("= << path << "), with topdir=3D" << topdir; return realPath; } } @@ -421,7 +421,7 @@ bool TrashImpl::move(const QString &src, const QString = &dest) QUrl urlSrc =3D QUrl::fromLocalFile(src); QUrl urlDest =3D QUrl::fromLocalFile(dest); = - qDebug() << urlSrc << " -> " << urlDest; + qDebug() << urlSrc << "->" << urlDest; KIO::CopyJob *job =3D KIO::moveAs(urlSrc, urlDest, KIO::HideProgressIn= fo); job->setUiDelegate(0); connect(job, SIGNAL(result(KJob*)), @@ -433,7 +433,7 @@ bool TrashImpl::move(const QString &src, const QString = &dest) = void TrashImpl::jobFinished(KJob *job) { - qDebug() << " error=3D" << job->error() << job->errorText(); + qDebug() << "error=3D" << job->error() << job->errorText(); error(job->error(), job->errorText()); = emit leaveModality(); @@ -478,7 +478,7 @@ bool TrashImpl::copy(const QString &src, const QString = &dest) m_lastErrorCode =3D 0; QUrl urlSrc =3D QUrl::fromLocalFile(src); QUrl urlDest =3D QUrl::fromLocalFile(dest); - qDebug() << "copying " << src << " to " << dest; + qDebug() << "copying" << src << "to" << dest; KIO::CopyJob *job =3D KIO::copyAs(urlSrc, urlDest, KIO::HideProgressIn= fo); job->setUiDelegate(0); connect(job, SIGNAL(result(KJob*)), @@ -490,7 +490,7 @@ bool TrashImpl::copy(const QString &src, const QString = &dest) = bool TrashImpl::directRename(const QString &src, const QString &dest) { - qDebug() << src << " -> " << dest; + qDebug() << src << "->" << dest; // Do not use QFile::rename here, we need to be able to move broken sy= mlinks too // (and we need to make sure errno is set) if (::rename(QFile::encodeName(src), QFile::encodeName(dest)) !=3D 0) { @@ -574,7 +574,7 @@ bool TrashImpl::synchronousDel(const QString &path, boo= l setLastErrorCode, bool // First ensure that all dirs have u+w permissions, // otherwise we won't be able to delete files in them (#130780). if (isDir) { - qDebug() << "chmod'ing " << url; + qDebug() << "chmod'ing" << url; KFileItem fileItem(url, QString::fromLatin1("inode/directory"), KF= ileItem::Unknown); KFileItemList fileItemList; fileItemList.append(fileItem); @@ -686,7 +686,7 @@ TrashImpl::TrashedFileInfoList TrashImpl::list() continue; } if (!fileName.endsWith(QLatin1String(".trashinfo"))) { - qWarning() << "Invalid info file found in " << infoPath <<= " : " << fileName; + qWarning() << "Invalid info file found in" << infoPath << = ":" << fileName; continue; } fileName.truncate(fileName.length() - 10); @@ -709,7 +709,7 @@ QStringList TrashImpl::listDir(const QString &physicalP= ath) = bool TrashImpl::infoForFile(int trashId, const QString &fileId, TrashedFil= eInfo &info) { - qDebug() << trashId << " " << fileId; + qDebug() << trashId << fileId; info.trashId =3D trashId; // easy :) info.fileId =3D fileId; // equally easy info.physicalPath =3D filesPath(trashId, fileId); @@ -754,7 +754,7 @@ QString TrashImpl::physicalPath(int trashId, const QStr= ing &fileId, const QStrin void TrashImpl::error(int e, const QString &s) { if (e) { - qDebug() << e << " " << s; + qDebug() << e << s; } m_lastErrorCode =3D e; m_lastErrorMessage =3D s; @@ -779,7 +779,7 @@ bool TrashImpl::isEmpty() const ep =3D readdir(dp); // look for third file closedir(dp); if (ep !=3D 0) { - //qDebug() << ep->d_name << " in " << infoPath << " -> not= empty"; + //qDebug() << ep->d_name << "in" << infoPath << "-> not em= pty"; return false; // not empty } } @@ -816,7 +816,7 @@ static int idForDevice(const Solid::Device &device) { const Solid::Block *block =3D device.as(); if (block) { - qDebug() << "major=3D" << block->deviceMajor() << " minor=3D" << b= lock->deviceMinor(); + qDebug() << "major=3D" << block->deviceMajor() << "minor=3D" << bl= ock->deviceMinor(); return block->deviceMajor() * 1000 + block->deviceMinor(); } else { // Not a block device. Maybe a NFS mount? @@ -841,20 +841,20 @@ int TrashImpl::findTrashDirectory(const QString &orig= Path) } QString mountPoint =3D mp->mountPoint(); const QString trashDir =3D trashForMountPoint(mountPoint, true); - qDebug() << "mountPoint=3D" << mountPoint << " trashDir=3D" << trashDi= r; + qDebug() << "mountPoint=3D" << mountPoint << "trashDir=3D" << trashDir; if (trashDir.isEmpty()) { return 0; // no trash available on partition } int id =3D idForTrashDirectory(trashDir); if (id > -1) { - qDebug() << " known with id " << id; + qDebug() << "known with id" << id; return id; } // new trash dir found, register it // but we need stability in the trash IDs, so that restoring or asking // for properties works even kio_trash gets killed because idle. #if 0 - qDebug() << "found " << trashDir; + qDebug() << "found" << trashDir; m_trashDirectories.insert(++m_lastId, trashDir); if (!mountPoint.endsWith('/')) { mountPoint +=3D '/'; @@ -904,7 +904,7 @@ void TrashImpl::scanTrashDirectories() const continue; } m_trashDirectories.insert(trashId, trashDir); - qDebug() << "found " << trashDir << " gave it id " << tras= hId; + qDebug() << "found" << trashDir << "gave it id" << trashId; if (!topdir.endsWith(QLatin1Char('/'))) { topdir +=3D QLatin1Char('/'); } @@ -956,12 +956,12 @@ QString TrashImpl::trashForMountPoint(const QString &= topdir, bool createIfNeeded && (buff.st_mode & 0777) =3D=3D 0700) { // rwx fo= r user return trashDir; } - qDebug() << "Directory " << trashDir << " exists but didn'= t pass the security checks, can't use it"; + qDebug() << "Directory" << trashDir << "exists but didn't = pass the security checks, can't use it"; } else if (createIfNeeded && initTrashDirectory(trashDir_c)) { return trashDir; } } else { - qDebug() << "Root trash dir " << rootTrashDir << " exists but = didn't pass the security checks, can't use it"; + qDebug() << "Root trash dir" << rootTrashDir << "exists but di= dn't pass the security checks, can't use it"; } } = @@ -978,7 +978,7 @@ QString TrashImpl::trashForMountPoint(const QString &to= pdir, bool createIfNeeded return trashDir; } } - qDebug() << "Directory " << trashDir << " exists but didn't pass t= he security checks, can't use it"; + qDebug() << "Directory" << trashDir << "exists but didn't pass the= security checks, can't use it"; // Exists, but not useable return QString(); } @@ -1020,7 +1020,7 @@ bool TrashImpl::initTrashDirectory(const QByteArray &= trashDir_c) const return checkTrashSubdirs(trashDir_c); = } else { - qDebug() << trashDir_c << " just created, by it doesn't have the r= ight permissions, probably some strange unsupported filesystem"; + qDebug() << trashDir_c << "just created, by it doesn't have the ri= ght permissions, probably some strange unsupported filesystem"; ::rmdir(trashDir_c); return false; }