Commit 5ceae9e0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some error

svn path=/trunk/KDE/kdebase/libkonq/; revision=538523
parent 275c6495
...@@ -308,7 +308,8 @@ bool KFileIVI::acceptDrop( const QMimeSource *mime ) const ...@@ -308,7 +308,8 @@ bool KFileIVI::acceptDrop( const QMimeSource *mime ) const
KUrl::List::Iterator it = uris.begin(); KUrl::List::Iterator it = uris.begin();
for ( ; it != uris.end() ; it++ ) for ( ; it != uris.end() ; it++ )
{ {
if ( m_fileitem->url().equals( *it, true /*ignore trailing slashes*/ ) ) KUrl::EqualsOptions flags = KUrl::CompareWithoutTrailingSlash;
if ( m_fileitem->url().equals( *it, flags /*ignore trailing slashes*/ ) )
return true; return true;
} }
} }
......
...@@ -805,7 +805,7 @@ void KonqIconViewWidget::setURL( const KUrl &kurl ) ...@@ -805,7 +805,7 @@ void KonqIconViewWidget::setURL( const KUrl &kurl )
d->pFileTip->setPreview( KGlobalSettings::showFilePreview(m_url) ); d->pFileTip->setPreview( KGlobalSettings::showFilePreview(m_url) );
if ( m_url.isLocalFile() ) if ( m_url.isLocalFile() )
m_dotDirectoryPath = m_url.path(1).append( ".directory" ); m_dotDirectoryPath = m_url.path(KUrl::AddTrailingSlash).append( ".directory" );
else else
m_dotDirectoryPath.clear(); m_dotDirectoryPath.clear();
} }
...@@ -827,7 +827,7 @@ void KonqIconViewWidget::startImagePreview( const QStringList &, bool force ) ...@@ -827,7 +827,7 @@ void KonqIconViewWidget::startImagePreview( const QStringList &, bool force )
KLibFactory *factory = KLibLoader::self()->factory("konq_sound"); KLibFactory *factory = KLibLoader::self()->factory("konq_sound");
if (factory) if (factory)
d->pSoundPlayer = static_cast<KonqSoundPlayer *>( d->pSoundPlayer = static_cast<KonqSoundPlayer *>(
factory->create(this, 0, "KonqSoundPlayer")); factory->create(this, "KonqSoundPlayer"));
d->bSoundPreviews = (d->pSoundPlayer != 0L); d->bSoundPreviews = (d->pSoundPlayer != 0L);
} }
......
...@@ -515,7 +515,7 @@ void KonqOperations::doFileCopy() ...@@ -515,7 +515,7 @@ void KonqOperations::doFileCopy()
bool linkOnly = false; bool linkOnly = false;
if (isDesktopFile && !KAuthorized::authorizeKAction("run_desktop_files") && if (isDesktopFile && !KAuthorized::authorizeKAction("run_desktop_files") &&
(m_destURL.path(1) == KGlobalSettings::desktopPath()) ) (m_destURL.path(KUrl::AddTrailingSlash) == KGlobalSettings::desktopPath()) )
{ {
linkOnly = true; linkOnly = true;
} }
...@@ -662,7 +662,7 @@ void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const KUrl& ...@@ -662,7 +662,7 @@ void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const KUrl&
op->setOperation( job, MOVE, lst, newurl ); op->setOperation( job, MOVE, lst, newurl );
(void) new KonqCommandRecorder( KonqCommand::MOVE, lst, newurl, job ); (void) new KonqCommandRecorder( KonqCommand::MOVE, lst, newurl, job );
// if moving the desktop then update config file and emit // if moving the desktop then update config file and emit
if ( oldurl.isLocalFile() && oldurl.path(1) == KGlobalSettings::desktopPath() ) if ( oldurl.isLocalFile() && oldurl.path(KUrl::AddTrailingSlash) == KGlobalSettings::desktopPath() )
{ {
kDebug(1203) << "That rename was the Desktop path, updating config files" << endl; kDebug(1203) << "That rename was the Desktop path, updating config files" << endl;
KConfig *globalConfig = KGlobal::config(); KConfig *globalConfig = KGlobal::config();
...@@ -747,8 +747,10 @@ void KonqOperations::slotResult( KJob * job ) ...@@ -747,8 +747,10 @@ void KonqOperations::slotResult( KJob * job )
void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const QString & name ) void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const QString & name )
{ {
KUrl newurl( oldurl ); KUrl newurl( oldurl );
newurl.setPath( oldurl.directory(false, true) + name ); //newurl.setPath( oldurl.directory(false, true) + name );
kDebug(1203) << "KonqOperations::rename("<<name<<") called. newurl=" << newurl << endl; KUrl::DirectoryOption flags = KUrl::IgnoreTrailingSlash;
newurl.setPath( oldurl.directory( flags ) +name);
kDebug(1203) << "KonqOperations::rename("<<name<<") called. newurl=" << newurl << endl;
rename( parent, oldurl, newurl ); rename( parent, oldurl, newurl );
} }
...@@ -756,7 +758,7 @@ void KonqOperations::newDir( QWidget * parent, const KUrl & baseURL ) ...@@ -756,7 +758,7 @@ void KonqOperations::newDir( QWidget * parent, const KUrl & baseURL )
{ {
bool ok; bool ok;
QString name = i18n( "New Folder" ); QString name = i18n( "New Folder" );
if ( baseURL.isLocalFile() && QFileInfo( baseURL.path(+1) + name ).exists() ) if ( baseURL.isLocalFile() && QFileInfo( baseURL.path(KUrl::AddTrailingSlash) + name ).exists() )
name = KIO::RenameDlg::suggestName( baseURL, i18n( "New Folder" ) ); name = KIO::RenameDlg::suggestName( baseURL, i18n( "New Folder" ) );
name = KInputDialog::getText ( i18n( "New Folder" ), name = KInputDialog::getText ( i18n( "New Folder" ),
......
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