From kde-commits Sun Mar 15 20:20:44 2009 From: Christian Ehrlicher Date: Sun, 15 Mar 2009 20:20:44 +0000 To: kde-commits Subject: KDE/kdebase/apps Message-Id: <1237148444.122064.18703.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123714845430053 SVN commit 939835 by chehrlic: a lot of more KUrl::path() -> KUrl::toLocalFile() changes (mostly after a check for KUrl::isLocalFile()) M +1 -1 dolphin/src/dolphinpart.cpp M +1 -1 dolphin/src/panels/terminal/terminalpanel.cpp M +1 -1 dolphin/src/statusbarspaceinfo.cpp M +1 -1 kfind/kfwin.cpp M +4 -4 konqueror/settings/konq/globalpaths.cpp M +1 -1 konqueror/shellcmdplugin/kshellcmdplugin.cpp M +2 -2 konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp M +1 -1 konqueror/src/konqmain.cpp M +8 -9 konqueror/src/konqmainwindow.cpp M +1 -1 konqueror/src/konqview.cpp M +1 -1 kwrite/kwritemain.cpp M +3 -3 lib/konq/knewmenu.cpp M +4 -4 lib/konq/konq_operations.cpp M +1 -1 nsplugins/viewer/nsplugin.cpp M +1 -1 plasma/applets/folderview/iconview.cpp --- trunk/KDE/kdebase/apps/dolphin/src/dolphinpart.cpp #939834:939835 @@ -508,7 +508,7 @@ //If the URL is local after the above conversion, set the directory. if (u.isLocalFile()) { - dir = u.path(); + dir = u.toLocalFile(); } KToolInvocation::invokeTerminal(QString(), dir); --- trunk/KDE/kdebase/apps/dolphin/src/panels/terminal/terminalpanel.cpp #939834:939835 @@ -56,7 +56,7 @@ Panel::setUrl(url); if ((m_terminal != 0) && isVisible() && url.isLocalFile()) { - m_terminal->sendInput("cd " + KShell::quoteArg(url.path()) + '\n'); + m_terminal->sendInput("cd " + KShell::quoteArg(url.toLocalFile()) + '\n'); } } --- trunk/KDE/kdebase/apps/dolphin/src/statusbarspaceinfo.cpp #939834:939835 @@ -81,7 +81,7 @@ return; } - KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(m_url.path()); + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(m_url.toLocalFile()); if (!mp) { return; } --- trunk/KDE/kdebase/apps/kfind/kfwin.cpp #939834:939835 @@ -210,7 +210,7 @@ if (!u.isValid() || !u.isLocalFile()) return; - QString filename = u.path(); + QString filename = u.toLocalFile(); QFile file(filename); --- trunk/KDE/kdebase/apps/konqueror/settings/konq/globalpaths.cpp #939834:939835 @@ -327,19 +327,19 @@ { if (!src.isLocalFile() || !dest.isLocalFile()) return true; - if (!QFile::exists(src.path())) + if (!QFile::exists(src.toLocalFile())) return true; m_ok = true; // TODO: check if the src dir is empty? Nothing to move, then... // Ask for confirmation before moving the files if ( KMessageBox::questionYesNo( this, i18n("The path for '%1' has been changed.\nDo you want the files to be moved from '%2' to '%3'?", - type, src.path(), dest.path()), i18n("Confirmation Required"), + type, src.toLocalFile(), dest.toLocalFile()), i18n("Confirmation Required"), KGuiItem(i18nc("Move files from old to new place", "Move")), KGuiItem(i18nc("Use the new directory but do not move files", "Do not Move"))) == KMessageBox::Yes ) { - if (QFile::exists(dest.path())) { + if (QFile::exists(dest.toLocalFile())) { // Destination already exists -- should always be the case, for most types, // but maybe not for the complex autostart case (to be checked...) m_copyToDest = dest; @@ -353,7 +353,7 @@ // slotEntries will move every file/subdir individually into the dest job->exec(); if (m_ok) { - QDir().rmdir(src.path()); // hopefully it's empty by now + QDir().rmdir(src.toLocalFile()); // hopefully it's empty by now } delete job; } --- trunk/KDE/kdebase/apps/konqueror/shellcmdplugin/kshellcmdplugin.cpp #939834:939835 @@ -69,7 +69,7 @@ else #endif { - path = url.path(); + path = url.toLocalFile(); } bool ok; QString cmd = KInputDialog::getText( i18n("Execute Shell Command"), --- trunk/KDE/kdebase/apps/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp #939834:939835 @@ -33,6 +33,7 @@ #include #include #include +#include #define MYMODULE static_cast(module()) @@ -65,9 +66,8 @@ KUrl url = m_fileItem.url(); if ( url.isLocalFile() ) { - QByteArray path( QFile::encodeName(url.path())); struct stat buff; - if ( ::stat( path.data(), &buff ) != -1 ) + if ( KDE::stat( url.toLocalFile(), &buff ) != -1 ) { //kDebug() << "KonqSidebarDirTreeItem::init " << path << " : " << buff.st_nlink; // The link count for a directory is generally subdir_count + 2. --- trunk/KDE/kdebase/apps/konqueror/src/konqmain.cpp #939834:939835 @@ -222,7 +222,7 @@ KUrl urlToOpen; QStringList filesToSelect; - if (url.isLocalFile() && QFile::exists(url.path())) // "konqueror index.html" + if (url.isLocalFile() && QFile::exists(url.toLocalFile())) // "konqueror index.html" urlToOpen = url; else urlToOpen = KUrl( KonqMisc::konqFilteredURL(0L, args->arg(i)) ); // "konqueror slashdot.org" --- trunk/KDE/kdebase/apps/konqueror/src/konqmainwindow.cpp #939834:939835 @@ -450,7 +450,7 @@ if ( fileName.indexOf( '*' ) != -1 || fileName.indexOf( '[' ) != -1 || fileName.indexOf( '?' ) != -1 ) { // Check that a file or dir with all the special chars in the filename doesn't exist - if ( url.isLocalFile() ? !QFile::exists( path ) : !KIO::NetAccess::exists( url, KIO::NetAccess::DestinationSide, this ) ) + if ( url.isLocalFile() ? !QFile::exists( url.toLocalFile() ) : !KIO::NetAccess::exists( url, KIO::NetAccess::DestinationSide, this ) ) { nameFilter = fileName; url.setFileName( QString() ); @@ -587,9 +587,8 @@ // Fast mode for local files: do the stat ourselves instead of letting KRun do it. if ( mimeType.isEmpty() && url.isLocalFile() ) { - QByteArray _path( QFile::encodeName(url.path())); KDE_struct_stat buff; - if ( KDE_stat( _path.data(), &buff ) != -1 ) + if ( KDE::stat( url.toLocalFile(), &buff ) != -1 ) mimeType = KMimeType::findByUrl( url, buff.st_mode )->name(); } @@ -834,7 +833,7 @@ KUrl urlDotDir( url ); urlDotDir.addPath(".directory"); bool HTMLAllowed = m_bHTMLAllowed; - QFile f( urlDotDir.path() ); + QFile f( urlDotDir.toLocalFile() ); if ( f.open(QIODevice::ReadOnly) ) { f.close(); KConfig config(urlDotDir.path(), KConfig::SimpleConfig); @@ -845,7 +844,7 @@ } QString indexFile; if ( HTMLAllowed && - ( !( indexFile = findIndexFile( url.path() ) ).isEmpty() ) ) { + ( !( indexFile = findIndexFile( url.toLocalFile() ) ).isEmpty() ) ) { mimeType = "text/html"; url = KUrl(indexFile); //serviceName.clear(); // cancel what we just set, this is not a dir finally @@ -1375,7 +1374,7 @@ for ( KUrl::List::ConstIterator it = lst.begin() ; it != lst.end() ; ++it ) { if ( !fileNameList.isEmpty() ) fileNameList += ", "; - if ( (*it).isLocalFile() && QFileInfo((*it).path()).isDir() ) + if ( (*it).isLocalFile() && QFileInfo((*it).toLocalFile()).isDir() ) { // Create a temp dir, so that we can put the ZIP file in it with a proper name QString zipFileName; @@ -1970,7 +1969,7 @@ { KUrl u( view->locationBarURL() ); if( u.isLocalFile() ) - m_pURLCompletion->setDir( u.path() ); + m_pURLCompletion->setDir( u.toLocalFile() ); else m_pURLCompletion->setDir( u.url() ); //needs work!! (DA) } @@ -4032,7 +4031,7 @@ m_ptaUseHTML->setEnabled( true ); else if ( m_currentView->serviceTypes().contains("text/html") ) { // Currently viewing an index.html file via this feature (i.e. url points to a dir) - QString locPath = KUrl( m_currentView->locationBarURL() ).path(); + QString locPath = KUrl( m_currentView->locationBarURL() ).toLocalFile(); m_ptaUseHTML->setEnabled( QFileInfo( locPath ).isDir() ); } else m_ptaUseHTML->setEnabled( false ); @@ -5323,7 +5322,7 @@ s_pCompletion->addItem( u ); if ( url.isLocalFile() ) - s_pCompletion->addItem( url.path() ); + s_pCompletion->addItem( url.toLocalFile() ); else if ( url.protocol() == http ) s_pCompletion->addItem( u.mid( 7 )); else if ( url.protocol() == ftp && --- trunk/KDE/kdebase/apps/konqueror/src/konqview.cpp #939834:939835 @@ -221,7 +221,7 @@ // but this would be more dangerous. If anything goes wrong in the code, // we might end up deleting a real file. if ( url.isLocalFile() ) - m_tempFile = url.path(); + m_tempFile = url.toLocalFile(); else kWarning(1202) << "Tempfile option is set, but URL is remote:" << url ; } --- trunk/KDE/kdebase/apps/kwrite/kwritemain.cpp #939834:939835 @@ -744,7 +744,7 @@ for ( int z = 0; z < args->count(); z++ ) { // this file is no local dir, open it, else warn - bool noDir = !args->url(z).isLocalFile() || !QDir (args->url(z).path()).exists(); + bool noDir = !args->url(z).isLocalFile() || !QDir (args->url(z).toLocalFile()).exists(); if (noDir) { --- trunk/KDE/kdebase/apps/lib/konq/knewmenu.cpp #939834:939835 @@ -491,7 +491,7 @@ KUrl defaultFile( *it ); defaultFile.addPath( KIO::encodeFileName( text ) ); - if ( defaultFile.isLocalFile() && QFile::exists( defaultFile.path() ) ) + if ( defaultFile.isLocalFile() && QFile::exists( defaultFile.toLocalFile() ) ) text = KIO::RenameDialog::suggestName( *it, text); KUrl templateUrl( entry.templatePath ); @@ -511,7 +511,7 @@ KUrl defaultFile( *(d->popupFiles.begin()) ); defaultFile.addPath( KIO::encodeFileName( text ) ); - if ( defaultFile.isLocalFile() && QFile::exists( defaultFile.path() ) ) + if ( defaultFile.isLocalFile() && QFile::exists( defaultFile.toLocalFile() ) ) text = KIO::RenameDialog::suggestName( *(d->popupFiles.begin()), text); name = KInputDialog::getText( QString(), entry.comment, @@ -585,7 +585,7 @@ const KUrl localUrl = KIO::NetAccess::mostLocalUrl(destUrl, d->m_parentWidget); if (localUrl.isLocalFile()) { // Normal (local) file. Need to "touch" it, kio_file copied the mtime. - (void) ::utime(QFile::encodeName(localUrl.path()), 0); + (void) ::utime(QFile::encodeName(localUrl.toLocalFile()), 0); } } } --- trunk/KDE/kdebase/apps/lib/konq/konq_operations.cpp #939834:939835 @@ -411,7 +411,7 @@ bool local = (*it).isLocalFile(); if ( KProtocolManager::supportsDeleting( *it ) && (!local || QFileInfo((*it).directory()).isWritable() )) mlst.append(*it); - if ( local && KDesktopFile::isDesktopFile((*it).path())) + if ( local && KDesktopFile::isDesktopFile((*it).toLocalFile())) isDesktopFile = true; if ( local && (*it).path().startsWith(KGlobalSettings::desktopPath())) itemIsOnDesktop = true; @@ -488,7 +488,7 @@ // extracting an archive -- in all cases, we can't implement a real move, // it's just a copy of the tempfile [and the source app will delete it later]. // https://www.intevation.de/roundup/kolab/issue2026 - if (url.isLocalFile() && url.path().startsWith(KStandardDirs::locateLocal("tmp", QString()))) { + if (url.isLocalFile() && url.toLocalFile().startsWith(KStandardDirs::locateLocal("tmp", QString()))) { sMoving = false; sDeleting = false; } @@ -597,7 +597,7 @@ op->setOperation( job, MOVE, newurl ); KIO::FileUndoManager::self()->recordJob( KIO::FileUndoManager::Rename, lst, newurl, job ); // if moving the desktop then update config file and emit - if ( oldurl.isLocalFile() && oldurl.path( KUrl::AddTrailingSlash ) == KGlobalSettings::desktopPath() ) + if ( oldurl.isLocalFile() && oldurl.toLocalFile( KUrl::AddTrailingSlash ) == KGlobalSettings::desktopPath() ) { kDebug(1203) << "That rename was the Desktop path, updating config files"; KSharedConfig::Ptr globalConfig = KGlobal::config(); @@ -697,7 +697,7 @@ { bool ok; QString name = i18n( "New Folder" ); - if ( baseUrl.isLocalFile() && QFileInfo( baseUrl.path( KUrl::AddTrailingSlash ) + name ).exists() ) + if ( baseUrl.isLocalFile() && QFileInfo( baseUrl.toLocalFile( KUrl::AddTrailingSlash ) + name ).exists() ) name = KIO::RenameDialog::suggestName( baseUrl, i18n( "New Folder" ) ); name = KInputDialog::getText ( i18n( "New Folder" ), --- trunk/KDE/kdebase/apps/nsplugins/viewer/nsplugin.cpp #939834:939835 @@ -1541,7 +1541,7 @@ if ( KUrl(_url).isLocalFile() ) { kDebug(1431) << "local file"; // local file can be passed directly - _fileURL = KUrl(_url).path(); + _fileURL = KUrl(_url).toLocalFile(); // without streaming stream is finished already if ( _onlyAsFile ) { --- trunk/KDE/kdebase/apps/plasma/applets/folderview/iconview.cpp #939834:939835 @@ -437,7 +437,7 @@ { // Check if the root item was deleted if (items.contains(m_dirModel->dirLister()->rootItem())) { - const QString path = m_dirModel->dirLister()->url().path(); + const QString path = m_dirModel->dirLister()->url().toLocalFile(); listingError(KIO::buildErrorString(KIO::ERR_DOES_NOT_EXIST, path)); } }