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 cf7f90b4 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Remove kstandarddirs

parent 302739f4
......@@ -33,6 +33,7 @@
#include <kmessagebox.h>
#include <kpassworddialog.h>
#include <kglobal.h>
#include <KSharedConfig>
#include "kopetepasswordedaccount.h"
#include "kopetepasswordwidget.h"
......
......@@ -20,10 +20,11 @@
#include "ircnetwork.h"
#include <kdebug.h>
#include <kstandarddirs.h> // for locate
// for locate
#include <qdom.h>
#include <qfile.h>
#include <QStandardPaths>
struct IRC::Networks::Private {
IRC::NetworkList networks;
......@@ -72,7 +73,7 @@ void Networks::slotReadNetworks()
{
d->networks.clear();
QFile xmlFile(KStandardDirs::locate("appdata", "ircnetworks.xml"));
QFile xmlFile(QStandardPaths::locate(QStandardPaths::DataLocation, "ircnetworks.xml"));
xmlFile.open(QIODevice::ReadOnly);
// FIXME
......@@ -160,7 +161,7 @@ bool Networks::slotSaveNetworkConfig() const
}
// kDebug(14121) << doc.toString(4);
QFile xmlFile(KStandardDirs::locateLocal("appdata", "ircnetworks.xml"));
QFile xmlFile(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "ircnetworks.xml");
if (xmlFile.open(QIODevice::WriteOnly)) {
QTextStream stream(&xmlFile);
......
......@@ -49,7 +49,7 @@
#include <kinputdialog.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kuser.h>
#include <qcheckbox.h>
......
......@@ -40,6 +40,7 @@
#include <algorithm>
#include <kconfiggroup.h>
#include <KSharedConfig>
IRCEditAccountWidget::IRCEditAccountWidget(IRCAccount *ident, QWidget *parent)
: QWidget(parent)
......@@ -211,7 +212,7 @@ void IRCEditAccountWidget::slotAddCtcp()
QString IRCEditAccountWidget::generateAccountId(const QString &network)
{
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
QString nextId = network;
uint accountNumber = 1;
......
......@@ -41,7 +41,7 @@
#include <kiconloader.h>
#include <kmessagebox.h>
#include <ksimpleconfig.h>
#include <kstandarddirs.h>
#include <kuser.h>
#include <qcheckbox.h>
......
......@@ -77,6 +77,7 @@
#include "jt_pubsub.h"
#include <sys/utsname.h>
#include <KSharedConfig>
#ifdef LIBJINGLE_SUPPORT
#include "libjingle.h"
......
......@@ -21,7 +21,7 @@
#include "jabber_protocol_debug.h"
#include <KLocalizedString>
#include <kiconloader.h>
#include <kstandarddirs.h>
#include <qtimer.h>
#include <qimage.h>
#include <qregexp.h>
......
......@@ -29,10 +29,11 @@
#include <qfile.h>
#include <qtextcodec.h>
#include <kstandarddirs.h>
#include "jabber_protocol_debug.h"
#include <xmpp_tasks.h>
#include <QStandardPaths>
#include "jabberaccount.h"
#include "jabberprotocol.h"
......@@ -487,7 +488,7 @@ void JabberCapabilitiesManager::discoRequestFinished()
void JabberCapabilitiesManager::loadCachedInformation()
{
QString capsFileName;
capsFileName = KStandardDirs::locateLocal("appdata", QStringLiteral("jabber-capabilities-cache.xml"));
capsFileName = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("jabber-capabilities-cache.xml");
// Load settings
QDomDocument doc;
......@@ -594,7 +595,7 @@ QString JabberCapabilitiesManager::clientVersion(const Jid &jid) const
void JabberCapabilitiesManager::saveInformation()
{
QString capsFileName;
capsFileName = KStandardDirs::locateLocal("appdata", QStringLiteral("jabber-capabilities-cache.xml"));
capsFileName = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("jabber-capabilities-cache.xml");
// Generate XML
QDomDocument doc;
......
......@@ -39,10 +39,11 @@
#include <QAction>
#include <kactionmenu.h>
#include <kicon.h>
#include <kstandarddirs.h>
#include <kio/netaccess.h>
#include <qinputdialog.h>
#include <kopeteview.h>
#include <QStandardPaths>
#include "kopetecontactlist.h"
#include "kopetegroup.h"
......@@ -814,7 +815,7 @@ void JabberContact::setPhoto( const QString &photoPath )
if(contactPhoto.width() > 96 || contactPhoto.height() > 96)
{
// Save image to a new location if the image isn't the correct format.
QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
QString newLocation( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) ;
// Scale and crop the picture.
contactPhoto = contactPhoto.scaled( 96, 96, Qt::KeepAspectRatio, Qt::SmoothTransformation );
......@@ -833,7 +834,7 @@ void JabberContact::setPhoto( const QString &photoPath )
else if (contactPhoto.width() < 32 || contactPhoto.height() < 32)
{
// Save image to a new location if the image isn't the correct format.
QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
QString newLocation( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) ;
// Scale and crop the picture.
contactPhoto = contactPhoto.scaled( 32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation );
......@@ -852,7 +853,7 @@ void JabberContact::setPhoto( const QString &photoPath )
else if (contactPhoto.width() != contactPhoto.height())
{
// Save image to a new location if the image isn't the correct format.
QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
QString newLocation( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) ;
if(contactPhoto.width() < contactPhoto.height())
contactPhoto = contactPhoto.copy((contactPhoto.width()-contactPhoto.height())/2, 0, contactPhoto.height(), contactPhoto.height());
......
......@@ -61,4 +61,4 @@ void BytestreamManager::deleteConnection(BSConnection *c, int msec)
}
}
}
\ No newline at end of file
}
......@@ -37,7 +37,7 @@
#include <krun.h>
#include <kio/netaccess.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
// libiris(XMPP backend) includes
#include "im.h"
......
......@@ -35,6 +35,7 @@
//#include <solid/devicenotifier.h>
//#include <solid/device.h>
#include <KSharedConfig>
#include "kopetecontact.h"
......
......@@ -29,7 +29,7 @@
#include <qtimer.h>
#include <KLocalizedString>
#include <kstandarddirs.h>
#include <qtextbrowser.h>
#include <kdebug.h>
......
......@@ -51,7 +51,7 @@
#include <kmessagebox.h>
#include <kdialog.h>
#include <knotification.h>
#include <kstandarddirs.h>
#include <kprotocolmanager.h>
#include "client.h"
......@@ -72,6 +72,7 @@
#include "oscarprotocol.h"
#include "oscarstatusmanager.h"
#include <kopetesockettimeoutwatcher.h>
#include <QStandardPaths>
using namespace Oscar;
......@@ -787,7 +788,7 @@ void OscarAccount::updateBuddyIcon( const QString &path )
if( image.height() > size.height())
image = image.copy( 0, ( image.height() - size.height() ) / 2, image.width(), size.height() );
QString newlocation( KStandardDirs::locateLocal( "appdata", "oscarpictures/" + accountId() + ".jpg" ) );
QString newlocation( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "oscarpictures/" + accountId() + ".jpg" ) ;
kDebug(OSCAR_RAW_DEBUG) << "Saving buddy icon: " << newlocation;
if ( !image.save( newlocation, "JPEG" ) )
......
......@@ -34,7 +34,7 @@
#include <krandom.h>
#include <kcodecs.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <qinputdialog.h>
#include <kfiledialog.h>
......
......@@ -21,6 +21,7 @@
#include <KLocalizedString>
#include <kglobal.h>
#include <kconfiggroup.h>
#include <KSharedConfig>
#include "kopeteaccountmanager.h"
......
......@@ -30,7 +30,7 @@
#include <kfiledialog.h>
#include <QLineEdit>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <ktoolinvocation.h>
#include <ktemporaryfile.h>
......@@ -40,6 +40,8 @@
#include <kio/job.h>
#include <kdialog.h>
#include <QIcon>
#include <QStandardPaths>
#include <KSharedConfig>
#include "kopetecontactlist.h"
#include "kopetechatsessionmanager.h"
......@@ -439,7 +441,7 @@ void QQContact::setDisplayPicture(KTemporaryFile *f)
//copy the temp file somewere else.
// in a better world, the file could be dirrectly wrote at the correct location.
// but the custom emoticon code is to deeply merged in the display picture code while it could be separated.
QString newlocation=KStandardDirs::locateLocal( "appdata", "qqpictures/"+ contactId().toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) ;
QString newlocation=QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "qqpictures/"+ contactId().toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ;
QString fileName = f->fileName();
f->setAutoRemove(false);
......@@ -453,7 +455,7 @@ void QQContact::setDisplayPicture(KTemporaryFile *f)
void QQContact::slotEmitDisplayPictureChanged()
{
QString newlocation=KStandardDirs::locateLocal( "appdata", "qqpictures/"+ contactId().toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) ;
QString newlocation=QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "qqpictures/"+ contactId().toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ;
setProperty( Kopete::Global::Properties::self()->photo() , newlocation );
emit displayPictureChanged();
}
......
......@@ -26,6 +26,7 @@
#include <QPixmap>
// KDE includes
#include <kdebug.h>
#include <QStandardPaths>
// Kopete includes
#include "qqprotocol.h"
#include "qqcontact.h"
......@@ -332,7 +333,7 @@ void dlgQQVCard::slotSelectPhoto()
img = img.copy(0, (img.height()-img.width())/2, img.height(), img.height());
}
m_photoPath = KStandardDirs::locateLocal("appdata", "qqphotos/" + m_contact->rosterItem().jid().full().toLower().replace(QRegExp("[./~]"),"-") +".png");
m_photoPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "qqphotos/" + m_contact->rosterItem().jid().full().toLower().replace(QRegExp("[./~]"),"-") +".png";
if( img.save(m_photoPath, "PNG") )
{
m_mainWidget->lblPhoto->setPixmap( QPixmap::fromImage(img) );
......
......@@ -33,7 +33,7 @@
#include <kfiledialog.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kio/netaccess.h>
#include <kdebug.h>
#include <ktoolinvocation.h>
......
......@@ -32,6 +32,7 @@
#include <kconfig.h>
#include <kstandarddirs.h>
#include <ktoolinvocation.h>
#include <KSharedConfig>
// Kopete Includes
#include "kopeteaccountmanager.h"
......
......@@ -29,6 +29,7 @@
#include <KGlobal>
#include <KLocale>
#include <KConfig>
#include <KSharedConfig>
// Local Includes
#include "wpaccount.h"
......
......@@ -32,7 +32,7 @@
#include <knotification.h>
#include <KCodecs>
#include <KInputDialog>
#include <KStandardDirs>
#include <KToolInvocation>
#include "kopetechatsessionmanager.h"
......
......@@ -41,7 +41,7 @@
#include <kmainwindow.h>
#include <ktoolbar.h>
#include <krun.h>
#include <kstandarddirs.h>
#include <kcomponentdata.h>
#include <kemoticons.h>
#include <kcodecs.h>
......@@ -65,6 +65,7 @@
#include "wlmchatsessioninkaction.h"
#ifdef HAVE_GIFLIB
#include <gif_lib.h>
#include <QStandardPaths>
/* old giflib has no GIFLIB_MAJOR, define to avoid cpp warnings */
#ifndef GIFLIB_MAJOR
#define GIFLIB_MAJOR 4
......@@ -1173,7 +1174,7 @@ WlmChatSession::requestDisplayPicture ()
}
if (isReady ())
{
QString newlocation = KGlobal::dirs()->locateLocal("appdata", "wlmpictures/" + QString(SHA1D.replace ('/', '_')));
QString newlocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "wlmpictures/" + QString(SHA1D.replace ('/', '_'));
getChatService()->requestDisplayPicture(generateSessionID(), QFile::encodeName(newlocation).constData(),
contact->getMsnObj().toUtf8().constData());
setDownloadDisplayPicture (false);
......
......@@ -25,7 +25,7 @@
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <kurl.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include "yahootypes.h"
......
......@@ -44,7 +44,7 @@
#include <QMenu>
#include <kmessagebox.h>
#include <krun.h>
#include <kstandarddirs.h>
#include <ktoolinvocation.h>
#include <QIcon>
#include <kmessagebox_queued.h>
......@@ -60,6 +60,7 @@
#include <kopetetransfermanager.h>
#include <kopeteview.h>
#include <kopeteaddedinfoevent.h>
#include <QStandardPaths>
// Yahoo
#include "yahoocontact.h"
......@@ -1673,7 +1674,7 @@ void YahooAccount::slotGotBuddyIconChecksum(const QString &who, int checksum)
}
if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() &&
QFile::exists( KStandardDirs::locateLocal( "appdata", "yahoopictures/"+ who.toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) ) )
QFile::exists( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "yahoopictures/"+ who.toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) )
{
qCDebug(YAHOO_PROTOCOL_LOG) << "Icon already exists. I will not request it again.";
return;
......@@ -1691,7 +1692,7 @@ void YahooAccount::slotGotBuddyIconInfo(const QString &who, KUrl url, int checks
}
if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() &&
QFile::exists( KStandardDirs::locateLocal( "appdata", "yahoopictures/"+ who.toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) ))
QFile::exists( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "yahoopictures/"+ who.toLower().replace(QRegExp("[./~]"),QStringLiteral("-")) +".png" ) )
{
qCDebug(YAHOO_PROTOCOL_LOG) << "Icon already exists. I will not download it again.";
return;
......@@ -1732,7 +1733,7 @@ void YahooAccount::setBuddyIcon( const KUrl &url )
else
{
QImage image( url.toLocalFile() );
QString newlocation( KStandardDirs::locateLocal( "appdata", "yahoopictures/"+ url.fileName().toLower() ) ) ;
QString newlocation( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "yahoopictures/"+ url.fileName().toLower() ) ;
QFile iconFile( newlocation );
QByteArray data;
uint expire = myself()->property( YahooProtocol::protocol()->iconExpire ).value().toInt();
......
......@@ -61,7 +61,7 @@
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <kimageio.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <ktoolinvocation.h>
#include <QIcon>
......
......@@ -39,7 +39,7 @@
#include <kfiledialog.h>
#include <kpassworddialog.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <ktoolinvocation.h>
#include <kmessagebox_queued.h>
......
......@@ -29,7 +29,7 @@
#include <kio/global.h>
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <kstandarddirs.h>
// Kopete Includes
#include <kopeteaccount.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