Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c563f120 authored by R. Harish Navnit's avatar R. Harish Navnit Committed by Pali Rohár

Port away from KUrl

parent 85237506
......@@ -253,8 +253,8 @@ ChatMessagePart::ChatMessagePart( Kopete::ChatSession *mgr, QWidget *parent )
connect( d->manager, SIGNAL(messageStateChanged(uint,Kopete::Message::MessageState)),
this, SLOT(messageStateChanged(uint,Kopete::Message::MessageState)) );
connect ( browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
this, SLOT(slotOpenURLRequest(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)) );
connect ( browserExtension(), SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
this, SLOT(slotOpenURLRequest(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)) );
connect( this, SIGNAL(popupMenu(QString,QPoint)),
this, SLOT(slotRightClick(QString,QPoint)) );
......@@ -309,7 +309,7 @@ void ChatMessagePart::slotScrollingTo( int y )
void ChatMessagePart::save()
{
const KUrl dummyUrl;
const QUrl dummyUrl;
QPointer <KFileDialog> dlg = new KFileDialog( dummyUrl, QLatin1String( "text/html text/plain" ), view() );
dlg->setCaption( i18n( "Save Conversation" ) );
dlg->setOperationMode( KFileDialog::Saving );
......@@ -323,7 +323,7 @@ void ChatMessagePart::save()
if ( ! dlg )
return;
KUrl saveURL = dlg->selectedUrl();
QUrl saveURL = dlg->selectedUrl();
KTemporaryFile *tempFile = new KTemporaryFile();
tempFile->setAutoRemove(false);
tempFile->open();
......@@ -356,12 +356,12 @@ void ChatMessagePart::save()
QString fileName = tempFile->fileName();
delete tempFile;
KIO::CopyJob *moveJob = KIO::move( KUrl( fileName ), saveURL, KIO::HideProgressInfo );
KIO::CopyJob *moveJob = KIO::move( QUrl( fileName ), saveURL, KIO::HideProgressInfo );
if ( !moveJob )
{
KMessageBox::queuedMessageBox( view(), KMessageBox::Error,
i18n("<qt>Could not open <b>%1</b> for writing.</qt>", saveURL.prettyUrl() ), // Message
i18n("<qt>Could not open <b>%1</b> for writing.</qt>", saveURL.toDisplayString() ), // Message
i18n("Error While Saving") ); //Caption
}
}
......@@ -376,10 +376,10 @@ void ChatMessagePart::pageDown()
view()->scrollBy( 0, view()->visibleHeight() );
}
void ChatMessagePart::slotOpenURLRequest(const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &)
void ChatMessagePart::slotOpenURLRequest(const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &)
{
kDebug(14000) << "url=" << url.url();
if ( url.protocol() == QLatin1String("kopetemessage") )
if ( url.scheme() == QLatin1String("kopetemessage") )
{
Kopete::Contact *contact = d->manager->account()->contacts().value( url.host() );
if ( contact )
......
......@@ -166,7 +166,7 @@ signals:
void tooltipEvent( const QString &textUnderMouse, QString &toolTip );
private slots:
void slotOpenURLRequest( const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments & );
void slotOpenURLRequest( const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments & );
void slotFileTransferIncomingDone( unsigned int id );
void slotScrollView();
void slotRenderingFinished();
......
......@@ -951,7 +951,7 @@ bool ChatView::isDragEventAccepted( const QDragMoveEvent * event ) const
}
}
// make sure it doesn't come from the current chat view - then it's an emoticon
else if ( KUrl::List::canDecode( event->mimeData() ) && m_manager->members().count() == 1 &&
else if ( QList<QUrl>::canDecode( event->mimeData() ) && m_manager->members().count() == 1 &&
( event->source() != (QWidget*)m_messagePart->view()->viewport() ) )
{
Kopete::ContactPtrList members = m_manager->members();
......@@ -998,9 +998,9 @@ void ChatView::dropEvent ( QDropEvent * event )
return;
}
KUrl::List urlList = KUrl::List::fromMimeData( event->mimeData() );
QList<QUrl> urlList = QList<QUrl>::fromMimeData( event->mimeData() );
for ( KUrl::List::Iterator it = urlList.begin(); it != urlList.end(); ++it )
for ( QList<QUrl>::Iterator it = urlList.begin(); it != urlList.end(); ++it )
{
if ( (*it).isLocalFile() )
{ //send a file
......
......@@ -25,7 +25,7 @@
#include <kstandarddirs.h>
#include <kdirlister.h>
#include <kdebug.h>
#include <kurl.h>
#include <QUrl>
#include <kglobal.h>
#include <karchive.h>
#include <kzip.h>
......@@ -60,7 +60,7 @@ public:
// key = style name, value = ChatWindowStyle instance
QHash<QString, ChatWindowStyle*> stylePool;
QStack<KUrl> styleDirs;
QStack<QUrl> styleDirs;
};
ChatWindowStyleManager *ChatWindowStyleManager::self()
......@@ -91,7 +91,7 @@ void ChatWindowStyleManager::loadStyles()
foreach(const QString &styleDir, chatStyles)
{
kDebug(14000) << styleDir;
d->styleDirs.push( KUrl(styleDir) );
d->styleDirs.push( QUrl(styleDir) );
}
d->styleDirLister = new KDirLister(this);
......@@ -308,7 +308,7 @@ bool ChatWindowStyleManager::removeStyle(const QString &styleName)
int numDeleted = 0;
foreach( const QString& stylePath, styleDirs )
{
KUrl urlStyle(stylePath);
QUrl urlStyle(stylePath);
// Do the actual deletion of the directory style.
if(KIO::NetAccess::del( urlStyle, 0 ))
numDeleted++;
......
......@@ -49,7 +49,7 @@
#include <kurlrequesterdialog.h>
#include <krun.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <QUrl>
#include <kemoticons.h>
#include <KCMultiDialog>
......@@ -405,7 +405,7 @@ void ChatWindowConfig::slotChatStyleVariantSelected(const QString &variantName)
void ChatWindowConfig::slotInstallChatStyle()
{
KUrl styleUrl = KFileDialog::getOpenUrl( KUrl(), QString::fromUtf8("application/zip application/x-compressed-tar application/x-bzip-compressed-tar"), this, i18n("Choose Chat Window Style to Install") );
QUrl styleUrl = KFileDialog::getOpenUrl( QUrl(), QString::fromUtf8("application/zip application/x-compressed-tar application/x-bzip-compressed-tar"), this, i18n("Choose Chat Window Style to Install") );
if ( styleUrl.isEmpty() ) // dialog got canceled
return;
......@@ -441,7 +441,7 @@ void ChatWindowConfig::slotInstallChatStyle()
}
}
int ChatWindowConfig::installChatStyle(const KUrl &styleToInstall)
int ChatWindowConfig::installChatStyle(const QUrl &styleToInstall)
{
int styleInstallReturn = ChatWindowStyleManager::StyleCannotOpen;
......@@ -504,7 +504,7 @@ void ChatWindowConfig::slotGetChatStyles()
{
if ( entry->status() == KNS::Entry::Installed && entry->installedFiles().size() > 0 )
{
KUrl styleFile( entry->installedFiles().at(0) );
QUrl styleFile( entry->installedFiles().at(0) );
int result = installChatStyle( styleFile );
QString packageName(entry->name().representation());
......
......@@ -53,7 +53,7 @@ public:
private slots:
//----- Style TAB ---------------------
void slotInstallChatStyle();
int installChatStyle(const KUrl &styleToInstall);
int installChatStyle(const QUrl &styleToInstall);
void slotDeleteChatStyle();
void slotChatStyleSelected(const QString &styleName);
void slotChatStyleVariantSelected(const QString &variantName);
......
......@@ -22,7 +22,7 @@
#include <KMessageBox>
#include <KStandardDirs>
#include <KUrl>
#include <QUrl>
#include <KGlobal>
#include <KConfig>
#include <KConfigGroup>
......
......@@ -25,7 +25,7 @@
#include <QTextDocument>
#include <QDomDocument>
#include <KUrl>
#include <QUrl>
#include <KDebug>
#include <KMessageBox>
#include <KEmoticonsTheme>
......@@ -403,15 +403,15 @@ bool ContactListModel::dropUrl( const QMimeData *data, int row, const QModelInde
QObject* metaContactObject = qVariantValue<QObject*>( parent.data( Kopete::Items::ObjectRole ) );
Kopete::MetaContact* metaContact = qobject_cast<Kopete::MetaContact*>(metaContactObject);
KUrl::List urlList = KUrl::List::fromMimeData( data );
for ( KUrl::List::Iterator it = urlList.begin(); it != urlList.end(); ++it )
QList<QUrl> urlList = data->urls();
for ( QList<QUrl>::Iterator it = urlList.begin(); it != urlList.end(); ++it )
{
KUrl url = (*it);
if( url.protocol() == QLatin1String( "kopetemessage" ) )
QUrl url = (*it);
if( url.scheme() == QLatin1String( "kopetemessage" ) )
{
//Add a contact
QString protocolId = url.queryItem( "protocolId" );
QString accountId = url.queryItem( "accountId" );
QString protocolId = QUrlQuery(url).queryItemValue( "protocolId" );
QString accountId = QUrlQuery(url).queryItemValue( "accountId" );
QString contactId = url.host();
kDebug() << "protocolId=" << protocolId << ", accountId=" << accountId << ", contactId=" << contactId;
......@@ -640,7 +640,7 @@ QString ContactListModel::metaContactTooltip( const Kopete::MetaContact* metaCon
#warning Currently using metaContact->picture().path() but should use replacement of KopeteMimeSourceFactory
#endif
#if 0
QString photoName = QLatin1String("kopete-metacontact-photo:%1").arg( KUrl::encode_string( metaContact->metaContactId() ));
QString photoName = QLatin1String("kopete-metacontact-photo:%1").arg( QUrl::encode_string( metaContact->metaContactId() ));
//QMimeSourceFactory::defaultFactory()->setImage( "contactimg", metaContact->photo() );
toolTip += QString::fromLatin1("<img src=\"%1\">").arg( photoName );
#endif
......
......@@ -233,7 +233,7 @@ void KopeteAddressBookExport::exportData()
if ( newValue( mUrl ) )
{
dirty = true;
mAddressee.setUrl( KUrl( mUrl->currentText() ) );
mAddressee.setUrl( QUrl( mUrl->currentText() ) );
}
QStringList newVals;
......
......@@ -518,7 +518,7 @@ void KopeteContactListView::sendFile()
{
Kopete::MetaContact* metaContact = metaContactFromIndex( currentIndex() );
if ( metaContact )
metaContact->sendFile( KUrl() );
metaContact->sendFile( QUrl() );
}
void KopeteContactListView::sendMessage()
......
......@@ -42,7 +42,7 @@
#include <KIconLoader>
#include <KGlobal>
#include <KLocale>
#include <KUrl>
#include <QUrl>
#include <KUrlRequester>
#include <KStandardDirs>
#include <KMessageBox>
......@@ -510,7 +510,7 @@ void KopeteMetaLVIProps::slotOkClicked()
mMetaContact->setPhotoSource(selectedPhotoSource());
mMetaContact->setPhotoSourceContact( selectedPhotoSourceContact() );
if ( !m_photoPath.isEmpty())
mMetaContact->setPhoto(KUrl(m_photoPath));
mMetaContact->setPhoto(QUrl(m_photoPath));
mMetaContact->setPhotoSyncedWithKABC( ui_mainWidget->chkSyncPhoto->isChecked() );
mMetaContact->setUseCustomIcon(
......@@ -620,7 +620,7 @@ void KopeteMetaLVIProps::slotOpenSoundDialog( KUrlRequester *requester )
soundDirs += KGlobal::dirs()->resourceDirs( "sound" );
if ( !soundDirs.isEmpty() ) {
KUrl soundURL;
QUrl soundURL;
QDir dir;
dir.setFilter( QDir::Files | QDir::Readable );
QStringList::ConstIterator it = soundDirs.constBegin();
......@@ -639,7 +639,7 @@ void KopeteMetaLVIProps::slotOpenSoundDialog( KUrlRequester *requester )
void KopeteMetaLVIProps::slotClearPhotoClicked()
{
m_photoPath.clear();
mMetaContact->setPhoto( KUrl() );
mMetaContact->setPhoto( QUrl() );
slotEnableAndDisableWidgets();
}
......
......@@ -26,7 +26,7 @@
#include <QByteArray>
#include <dcopobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <QUrl>
/**
* Generic DCOP interface for KDE instant messenger applications
......@@ -155,11 +155,11 @@ k_dcop:
/**
* Send the file to the contact
* @param uid the KABC uid you are sending to.
* @param sourceURL a @ref KUrl to send.
* @param sourceURL a @ref QUrl to send.
* @param altFileName an alternate filename describing the file
* @param fileSize file size in bytes
*/
virtual void sendFile(const QString &uid, const KUrl &sourceURL,
virtual void sendFile(const QString &uid, const QUrl &sourceURL,
const QString &altFileName = QString(), uint fileSize = 0) = 0;
// MUTATORS
......
......@@ -351,7 +351,7 @@ void KopeteApplication::handleURLArgs()
{
for ( int i = 0; i < args->count(); i++ )
{
KUrl u( args->url( i ) );
QUrl u( args->url( i ) );
if ( !u.isValid() )
continue;
......
......@@ -24,7 +24,7 @@
#include <QLatin1String>
// KDE includes
#include <kurl.h>
#include <QUrl>
#include <kplugininfo.h>
// Kopete includes
......@@ -175,7 +175,7 @@ void KopeteDBusInterface::setIdentityAvatar(const QString &avatarUrl,
// Add the avatar using AvatarManager
Kopete::AvatarManager::AvatarEntry avatarEntry;
avatarEntry.name = "D-Bus Avatar";
avatarEntry.path = KUrl(avatarUrl).path();
avatarEntry.path = QUrl(avatarUrl).path();
avatarEntry.category = Kopete::AvatarManager::User;
avatarEntry = Kopete::AvatarManager::self()->add(avatarEntry);
......@@ -379,7 +379,7 @@ void KopeteDBusInterface::sendFile(const QString &contactId,
Kopete::Contact *destContact = destMetaContact->execute();
if (destContact && destContact->isFileCapable())
{
destContact->sendFile(KUrl(fileUrl));
destContact->sendFile(QUrl(fileUrl));
}
}
}
......
......@@ -61,7 +61,7 @@
#include <kplugininfo.h>
#include <ksqueezedtextlabel.h>
#include <kstringhandler.h>
#include <kurl.h>
#include <QUrl>
#include <kxmlguifactory.h>
#include <ktoolbar.h>
#include <kdialog.h>
......
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