CVS commit by faure: GUI: Retitle the Paste action depending on what it's going to paste: file, N files, url, N urls, or "clipboard contents" (#39489) Hmm, should the latter be "Paste clipboard into file"? M +13 -3 konq_dirpart.cc 1.88 --- kdebase/libkonq/konq_dirpart.cc #1.87:1.88 @@ -430,6 +430,16 @@ void KonqDirPart::updatePasteAction() { QMimeSource *data = QApplication::clipboard()->data(); - bool paste = ( data->format() != 0 ); - + bool paste = ( data->format(0) != 0 ); + KURL::List urls; + if ( KURLDrag::canDecode( data ) && KURLDrag::decode( data, urls ) ) { + if ( urls.isEmpty() ) + paste = false; + else if ( urls.first().isLocalFile() ) + emit m_extension->setActionText( "paste", i18n( "&Paste file", "&Paste %n files", urls.count() ) ); + else + emit m_extension->setActionText( "paste", i18n( "&Paste URL", "&Paste %n URLs", urls.count() ) ); + } else if ( paste ) { + emit m_extension->setActionText( "paste", i18n( "&Paste clipboard contents" ) ); + } emit m_extension->enableAction( "paste", paste ); // TODO : if only one url, check that it's a dir }