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 2b97a12b authored by R. Harish Navnit's avatar R. Harish Navnit Committed by Pali Rohár

Fix, fix, dirty fixes, workarounds, cleanup

parent 2086ed48
......@@ -272,7 +272,7 @@ void ChatView::resetFontAndColor()
return;
QString contactListGroup = QString(QLatin1String("chatwindow_") + QString(mc->metaContactId().toString()));
KConfigGroup config = KGlobal::config()->group(contactListGroup);
KConfigGroup config = KSharedConfig::openConfig()->group(contactListGroup);
editPart()->resetConfig( config );
config.sync();
}
......@@ -807,7 +807,7 @@ void ChatView::messageSentSuccessfully()
void ChatView::saveOptions()
{
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup kopeteChatWindowMainWinSettings( config, ( msgManager()->form() == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) );
kopeteChatWindowMainWinSettings.writeEntry( QLatin1String("ChatViewSplitter"), d->splitter->saveState().toBase64() );
saveChatSettings();
......@@ -826,7 +826,7 @@ void ChatView::saveChatSettings()
QString contactListGroup = QString(QLatin1String("chatwindow_") +
QString(mc->metaContactId().toString()));
KConfigGroup config = KGlobal::config()->group(contactListGroup);
KConfigGroup config = KSharedConfig::openConfig()->group(contactListGroup);
// If settings are the same as default delete entry from config. This will propagate global setting change.
if ( editPart()->isRichTextEnabled() != Kopete::BehaviorSettings::self()->richTextByDefault() )
......@@ -852,7 +852,7 @@ void ChatView::loadChatSettings()
//read settings for metacontact
QString contactListGroup = QString(QLatin1String("chatwindow_") +
QString(contacts.first()->metaContact()->metaContactId().toString()));
KConfigGroup config(KGlobal::config(), contactListGroup );
KConfigGroup config(KSharedConfig::openConfig(), contactListGroup );
bool enableRichText = config.readEntry( "EnableRichText", Kopete::BehaviorSettings::self()->richTextByDefault() );
editPart()->textEdit()->setRichTextEnabled( enableRichText );
emit rtfEnabled( this, editPart()->isRichTextEnabled() );
......@@ -863,7 +863,7 @@ void ChatView::loadChatSettings()
void ChatView::readOptions()
{
KConfigGroup kopeteChatWindowMainWinSettings( KGlobal::config(), ( msgManager()->form() == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) );
KConfigGroup kopeteChatWindowMainWinSettings( KSharedConfig::openConfig(), ( msgManager()->form() == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) );
//kDebug(14000) << "reading splitterpos from key: " << dockKey;
QByteArray state;
state = kopeteChatWindowMainWinSettings.readEntry( QLatin1String("ChatViewSplitter"), state );
......@@ -928,6 +928,8 @@ void ChatView::dragMoveEvent( QDragMoveEvent * event )
bool ChatView::isDragEventAccepted( const QDragMoveEvent * event ) const
{
/**
* TODO: Implement virtual functions in QDragMoveEvent
if( event->provides( "application/kopete.metacontacts.list" ) )
{
QByteArray encodedData = event->encodedData ( "application/kopete.metacontacts.list" );
......@@ -959,9 +961,12 @@ bool ChatView::isDragEventAccepted( const QDragMoveEvent * event ) const
if ( contact && contact->canAcceptFiles() )
return true;
}
*/
return false;
}
/* TODO : Zero uses of dropEvent() function found.
* Fix the errors or remove the function ?
void ChatView::dropEvent ( QDropEvent * event )
{
Kopete::ContactPtrList contacts;
......@@ -1018,6 +1023,7 @@ void ChatView::dropEvent ( QDropEvent * event )
QWidget::dropEvent(event);
}
*/
void ChatView::registerContextMenuHandler( QObject *target, const char* slot )
{
......
......@@ -265,7 +265,7 @@ KopeteChatWindow::KopeteChatWindow( Kopete::ChatSession::Form form, QWidget *par
windows.append( this );
windowListChanged();
m_alwaysShowTabs = KGlobal::config()->group( "ChatWindowSettings" ).
m_alwaysShowTabs = KSharedConfig::openConfig()->group( "ChatWindowSettings" ).
readEntry( QLatin1String("AlwaysShowTabs"), false );
// kDebug( 14010 ) << "Open Windows: " << windows.count();
......@@ -399,13 +399,13 @@ void KopeteChatWindow::initActions(void)
tabRight=new QAction( i18n( "&Activate Next Tab" ), coll );
coll->addAction( "tabs_right", tabRight );
tabRight->setShortcut( KStandardShortcut::tabNext() );
tabRight->setShortcuts( KStandardShortcut::tabNext() );
tabRight->setEnabled( false );
connect( tabRight, SIGNAL(triggered(bool)), this, SLOT(slotNextTab()) );
tabLeft=new QAction( i18n( "&Activate Previous Tab" ), coll );
coll->addAction( "tabs_left", tabLeft );
tabLeft->setShortcut( KStandardShortcut::tabPrev() );
tabLeft->setShortcuts( KStandardShortcut::tabPrev() );
tabLeft->setEnabled( false );
connect( tabLeft, SIGNAL(triggered(bool)), this, SLOT(slotPreviousTab()) );
......@@ -503,7 +503,8 @@ void KopeteChatWindow::initActions(void)
QAction *animAction = new QAction( i18n("Toolbar Animation"), coll );
coll->addAction( "toolbar_animation", animAction );
animAction->setDefaultWidget( anim );
QWidgetAction *animWidgetAction = static_cast<QWidgetAction *>(animAction);
animWidgetAction->setDefaultWidget( anim );
//toolBar()->insertWidget( 99, anim->width(), anim );
//toolBar()->alignItemRight( 99 );
......@@ -650,7 +651,7 @@ void KopeteChatWindow::createTabBar()
{
if( !m_tabBar )
{
KConfigGroup cg( KGlobal::config(), QLatin1String("ChatWindowSettings") );
KConfigGroup cg( KSharedConfig::openConfig(), QLatin1String("ChatWindowSettings") );
m_tabBar = new KTabWidget( mainArea );
m_tabBar->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
......@@ -1167,7 +1168,7 @@ void KopeteChatWindow::readOptions()
{
// load and apply config file settings affecting the appearance of the UI
// kDebug(14010) ;
applyMainWindowSettings( KGlobal::config()->group( ( initialForm == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) ) );
applyMainWindowSettings( KSharedConfig::openConfig()->group( ( initialForm == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) ) );
//config->setGroup( QLatin1String("ChatWindowSettings") );
}
......@@ -1175,12 +1176,12 @@ void KopeteChatWindow::saveOptions()
{
// kDebug(14010) ;
KConfigGroup kopeteChatWindowMainWinSettings( KGlobal::config(), ( initialForm == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) );
KConfigGroup kopeteChatWindowMainWinSettings( KSharedConfig::openConfig(), ( initialForm == Kopete::ChatSession::Chatroom ? QLatin1String( "KopeteChatWindowGroupMode" ) : QLatin1String( "KopeteChatWindowIndividualMode" ) ) );
// saves menubar,toolbar and statusbar setting
saveMainWindowSettings( kopeteChatWindowMainWinSettings );
if ( m_tabBar ) {
KConfigGroup chatWindowSettings( KGlobal::config(), QLatin1String("ChatWindowSettings") );
KConfigGroup chatWindowSettings( KSharedConfig::openConfig(), QLatin1String("ChatWindowSettings") );
chatWindowSettings.writeEntry ( QLatin1String("Tab Placement"), (int)m_tabBar->tabPosition() );
chatWindowSettings.sync();
}
......
......@@ -356,7 +356,7 @@ ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleNa
// NOTE: This is a hidden config switch for style developers
// Check in the config if the cache is disabled.
// if the cache is disabled, reload the style every time it's getted.
KConfigGroup config(KGlobal::config(), "KopeteStyleDebug");
KConfigGroup config(KSharedConfig::openConfig(), "KopeteStyleDebug");
bool disableCache = config.readEntry("disableStyleCache", false);
if(disableCache)
{
......
......@@ -70,7 +70,6 @@
#include <QAction>
K_PLUGIN_FACTORY( EmailWindowPluginFactory, registerPlugin<EmailWindowPlugin>(); )
K_EXPORT_PLUGIN( EmailWindowPluginFactory( "kopete_emailwindow" ) )
EmailWindowPlugin::EmailWindowPlugin(QObject *parent, const QVariantList &) :
Kopete::ViewPlugin( parent )
......@@ -187,7 +186,7 @@ KopeteEmailWindow::KopeteEmailWindow( Kopete::ChatSession *manager, EmailWindowP
else
toggleMode( Send );
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
applyMainWindowSettings( config->group( QLatin1String( "KopeteEmailWindow" ) ) );
d->sendInProgress = false;
......@@ -205,7 +204,7 @@ KopeteEmailWindow::~KopeteEmailWindow()
emit( closing( this ) );
// saves menubar, toolbar and statusbar setting
KConfigGroup cg( KGlobal::config(), QLatin1String( "KopeteEmailWindow" ) );
KConfigGroup cg( KSharedConfig::openConfig(), QLatin1String( "KopeteEmailWindow" ) );
saveMainWindowSettings( cg );
cg.sync();
......@@ -311,7 +310,7 @@ void KopeteEmailWindow::slotSmileyActivated(const QString &sm )
void KopeteEmailWindow::slotConfToolbar()
{
KConfigGroup cg( KGlobal::config(), QLatin1String( "KopeteEmailWindow" ) );
KConfigGroup cg( KSharedConfig::openConfig(), QLatin1String( "KopeteEmailWindow" ) );
saveMainWindowSettings( cg );
QPointer <KEditToolBar> dlg = new KEditToolBar(actionCollection());
dlg->setResourceFile("kopeteemailwindow.rc");
......
......@@ -109,8 +109,8 @@ KopeteRichTextWidget::KopeteRichTextWidget(QWidget* parent, Kopete::Protocol::Ca
KopeteRichTextWidget::~KopeteRichTextWidget()
{
KConfigGroup configGroupMode( KGlobal::config(), QLatin1String( "KopeteChatWindowGroupMode" ));
KConfigGroup configIndividual( KGlobal::config(), QLatin1String( "KopeteChatWindowIndividualMode" ));
KConfigGroup configGroupMode( KSharedConfig::openConfig(), QLatin1String( "KopeteChatWindowGroupMode" ));
KConfigGroup configIndividual( KSharedConfig::openConfig(), QLatin1String( "KopeteChatWindowIndividualMode" ));
configGroupMode.writeEntry( "AutoResize", d->autoResize->isChecked());
configIndividual.writeEntry( "AutoResize", d->autoResize->isChecked());
delete d;
......@@ -162,7 +162,7 @@ void KopeteRichTextWidget::slotEnableAutoResize(bool enable)
void KopeteRichTextWidget::createActions(KActionCollection *actionCollection)
{
KConfigGroup config(KGlobal::config(), QLatin1String("KopeteChatWindowIndividualMode"));
KConfigGroup config(KSharedConfig::openConfig(), QLatin1String("KopeteChatWindowIndividualMode"));
bool autoResizeEnabled = config.readEntry("AutoResize", true);
d->autoResize = new KToggleAction( i18n("Input auto-resize"), actionCollection );
......
......@@ -23,6 +23,7 @@
#include "tooltipeditdialog.h"
#include <QTimer>
#include <QCheckBox>
#include <QDir>
#include <QLayout>
......@@ -42,7 +43,7 @@
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kio/netaccess.h>
#include <khtmlview.h>
#include <KF5/KHtml/khtmlview.h>
#include <klineedit.h>
#include <klocale.h>
#include <kmessagebox.h>
......@@ -51,6 +52,7 @@
#include <kurlrequesterdialog.h>
#include <krun.h>
#include <kfiledialog.h>
#include <KGlobal>
#include "kopeteglobal.h"
......@@ -85,7 +87,7 @@ public:
AppearanceConfig::AppearanceConfig(QWidget *parent, const QVariantList &args )
: KCModule( KopeteAppearanceConfigFactory::componentData(), parent, args ), d(new Private())
: KCModule( parent, args ), d(new Private())
{
QVBoxLayout *layout = new QVBoxLayout(this);
// since the tab widget is already within a layout with margins in the KSettings::Dialog
......@@ -95,7 +97,7 @@ AppearanceConfig::AppearanceConfig(QWidget *parent, const QVariantList &args )
d->mAppearanceTabCtl->setObjectName("mAppearanceTabCtl");
layout->addWidget( d->mAppearanceTabCtl );
KConfigGroup config(KGlobal::config(), "ChatWindowSettings");
KConfigGroup config(KSharedConfig::openConfig(), "ChatWindowSettings");
// "Contact List" TAB =======================================================
QWidget *contactListWidget = new QWidget(d->mAppearanceTabCtl);
......
......@@ -85,7 +85,7 @@ Token::value() const
return m_value;
}
KIcon
QIcon
Token::icon() const
{
return m_icon;
......
......@@ -43,7 +43,7 @@ class Token : public QWidget
explicit Token( const QString &text, const QString &iconName, int value, QWidget *parent = 0 );
KIcon icon() const;
QIcon icon() const;
QString iconName() const;
QString name() const;
int value() const;
......@@ -57,7 +57,7 @@ class Token : public QWidget
protected:
QString m_name;
KIcon m_icon;
QIcon m_icon;
QString m_iconName;
int m_value;
......
......@@ -21,11 +21,12 @@
#include "Token.h"
#include <QDrag>
#include <QtDebug>
#include <QMimeData>
#include <QDropEvent>
#include <QVBoxLayout>
#include <QtDebug>
/** TokenDragger - eventfilter that drags a token, designed to be a child of TokenDropTarget
This is necessary, as if TokenDropTarget would QDrag::exec() itself, the eventFilter would be blocked
and thus not be able to handle other events for the parenting widget, like e.g. dragEnter... */
......@@ -150,7 +151,8 @@ TokenDropTarget::accept( QDropEvent *de )
return false;
}
if ( de->source() && parentWidget() && de->source()->parentWidget() == parentWidget() )
//FIXME : Find the apt replacement for : de->source()->parentWidget()
if ( de->source() && parentWidget() && de->source()->findChild<QWidget *>()->parentWidget() == parentWidget() )
{ // move
de->setDropAction(Qt::MoveAction);
de->accept();
......
......@@ -19,6 +19,8 @@
#include <KApplication>
#include <QtGui/QDrag>
#include <QMimeData>
#include <QMouseEvent>
......@@ -128,7 +130,7 @@ TokenPool::performDrag( QMouseEvent *event )
QDataStream dataStream( &itemData, QIODevice::WriteOnly );
dataStream << token->name() << token->iconName() << token->value() << QPoint( event->pos() - rect().topLeft() );
QMimeData *mimeData = new QMimeData;
QMimeData *mimeData = new QMimeData();
mimeData->setData( m_mimeType, itemData );
QDrag *drag = new QDrag( this );
......
......@@ -105,8 +105,8 @@ TooltipEditDialog::TooltipEditDialog(QWidget *parent)
tbDown->setAutoRepeat(true);
connect(tbDown, SIGNAL(clicked()), SLOT(slotDownButton()));
KIcon left = QIcon::fromTheme("go-previous");
KIcon right = QIcon::fromTheme("go-next");
QIcon left = QIcon::fromTheme("go-previous");
QIcon right = QIcon::fromTheme("go-next");
tbAdd->setIcon(QApplication::isRightToLeft() ? left : right);
tbAdd->setEnabled(false);
......
......@@ -150,7 +150,7 @@ ChatWindowConfig::ChatWindowConfig(QWidget *parent, const QVariantList &args )
m_previewProtocol(0L), m_previewAccount(0L),
m_jackMetaContact(0L), m_myself(0L), m_jack(0L)
{
KConfigGroup config(KGlobal::config(), "ChatWindowSettings");
KConfigGroup config(KSharedConfig::openConfig(), "ChatWindowSettings");
QVBoxLayout *layout = new QVBoxLayout(this);
// since KSetting::Dialog has margins here, we don't need our own.
......@@ -484,7 +484,7 @@ void ChatWindowConfig::slotDeleteChatStyle()
void ChatWindowConfig::slotGetChatStyles()
{
KConfigGroup configGrp(KGlobal::config(), "KNewStuff2");
KConfigGroup configGrp(KSharedConfig::openConfig(), "KNewStuff2");
configGrp.writeEntry("ProvidersUrl", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml");
configGrp.writeEntry("TargetDir", "kopete_chatstyles");
configGrp.sync();
......@@ -495,7 +495,9 @@ void ChatWindowConfig::slotGetChatStyles()
// FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
// the settings dialog there is no active valid KComponentData, which KNS2 relies on.
// Forcing an active one below works around bug 163382, but the problem is somewhere else.
KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
// FIXME: componentData() is not a member of KopeteChatWindowConfigFactory
//KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
KNS::Entry::List entries = engine->downloadDialogModal(this);
......@@ -725,7 +727,9 @@ void ChatWindowConfig::slotManageEmoticonThemes()
// FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
// the settings dialog there is no active valid KComponentData, which KNS2 relies on.
// Forcing an active one below works around bug 165919, but the problem is somewhere else.
KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
// FIXME: componentData() is not a member of KopeteChatWindowConfigFactory
//KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
KCMultiDialog *kcm = new KCMultiDialog( this );
kcm->setWindowTitle( i18n( "Configure Emoticon Themes" ) );
......
......@@ -65,7 +65,7 @@ LayoutManager::LayoutManager()
loadDefaultLayouts();
loadUserLayouts();
KConfigGroup config( KGlobal::config(), "ContactList Layout" );
KConfigGroup config( KSharedConfig::openConfig(), "ContactList Layout" );
m_activeLayout = config.readEntry( "CurrentLayout", DefaultStyleName );
// Fallback to default
......@@ -85,7 +85,7 @@ void LayoutManager::setActiveLayout( const QString &layout )
{
kDebug() << layout;
m_activeLayout = layout;
KConfigGroup config(KGlobal::config(), "ContactList Layout");
KConfigGroup config(KSharedConfig::openConfig(), "ContactList Layout");
config.writeEntry( "CurrentLayout", m_activeLayout );
emit( activeLayoutChanged() );
}
......
......@@ -26,11 +26,11 @@
#include <QDomDocument>
#include <QUrl>
#include <KDebug>
#include <KMessageBox>
#include <KEmoticonsTheme>
#include <KLocalizedString>
#include <kmessagebox_queued.h>
#include <KF5/KI18n/KLocalizedString>
#include <KF5/KDELibs4Support/KDE/KDebug>
#include <KF5/KEmoticons/KEmoticonsTheme>
#include <KF5/KDELibs4Support/kmessagebox_queued.h>
#include "kopeteaccount.h"
#include "kopetepicture.h"
......@@ -489,10 +489,9 @@ bool ContactListModel::dropMetaContacts( int row, const QModelIndex &parent, Qt:
displayNames << mc->displayName();
}
if( KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(),
i18n( "<qt>Are you sure you want to merge meta contacts?\n<b>%1</b>", displayNames.join( ", " ) ),
i18n( "Meta Contact Merge" ), KStandardGuiItem::yes(), KStandardGuiItem::no(),
"askDDMergeMetaContacts", KMessageBox::Notify | KMessageBox::Dangerous ) != KMessageBox::Yes )
if( KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(), i18n( "<qt>Are you sure you want to merge meta contacts?\n<b>%1</b>", displayNames.join( ", " ) ),
i18n( "Meta Contact Merge" ), KStandardGuiItem::yes(), KStandardGuiItem::no(),"askDDMergeMetaContacts",
KMessageBox::Dangerous ) != KMessageBox::Yes)
{
return false;
}
......
......@@ -19,9 +19,9 @@
#ifndef KOPETE_UI_CONTACTLISTMODEL_H
#define KOPETE_UI_CONTACTLISTMODEL_H
#include <QAbstractItemModel>
#include <QPair>
#include <QHash>
#include <QAbstractItemModel>
#include <kopete_export.h>
......
......@@ -41,7 +41,7 @@
#include "kopetecommandhandler.h"
#include "kopetecontactlist.h"
#include "kopeteglobal.h"
#include "kopetefileengine.h"
//#include "kopetefileengine.h"
#include "kopetemimetypehandler.h"
#include "kopetepluginmanager.h"
#include "kopeteprotocol.h"
......@@ -91,7 +91,8 @@ KopeteApplication::KopeteApplication()
*/
QTimer::singleShot( 0, this, SLOT(slotLoadPlugins()) );
m_fileEngineHandler = new Kopete::FileEngineHandler();
//NOTE : QAbstractFileEngine and QAbstractFileEngineHandler deprecated in Qt5
//m_fileEngineHandler = new Kopete::FileEngineHandler();
//Create the emoticon installer
m_emoticonHandler = new Kopete::EmoticonMimeTypeHandler;
......@@ -124,7 +125,7 @@ KopeteApplication::~KopeteApplication()
delete plugin;
}
delete m_fileEngineHandler;
//delete m_fileEngineHandler;
delete m_emoticonHandler;
//kDebug( 14000 ) << "Done";
}
......@@ -134,7 +135,7 @@ void KopeteApplication::slotLoadPlugins()
// we have to load the address book early, because calling this enters the Qt event loop when there are remote resources.
// The plugin manager is written with the assumption that Kopete will not reenter the event loop during plugin load,
// otherwise lots of things break as plugins are loaded, then contacts are added to incompletely initialised MCLVIs
Kopete::KABCPersistence::self()->addressBook();
//Kopete::KABCPersistence::self()->addressbook();
//Create the command handler (looks silly)
Kopete::CommandHandler::commandHandler();
......@@ -146,7 +147,7 @@ void KopeteApplication::slotLoadPlugins()
Kopete::AccountManager::self()->load();
Kopete::ContactList::self()->load();
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
// Parse command-line arguments
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
......
......@@ -78,7 +78,8 @@ private:
QPointer<KopeteWindow> m_mainWindow;
bool m_isShuttingDown;
Kopete::MimeTypeHandler *m_emoticonHandler;
Kopete::FileEngineHandler *m_fileEngineHandler;
//NOTE: QAbstractFileEngine and QAbstractFileEngineHandler deprecated in Qt5
//Kopete::FileEngineHandler *m_fileEngineHandler;
private:
void handleURLArgs();
};
......
......@@ -447,7 +447,7 @@ QVariantMap KopeteDBusInterface::contactProperties(const QString &contactId)
properties["id"] = contact->metaContactId().toString();
if (contact->photoSource() == Kopete::MetaContact::SourceCustom)
{
properties["picture"] = contact->customPhoto().prettyUrl();
properties["picture"] = contact->customPhoto().toDisplayString();
}
else
{
......
......@@ -66,7 +66,7 @@ void ContactStalker::slotEmitSignal()
{
if (m_contact)
{
emit contactChanged(m_contact->metaContactId());
emit contactChanged(m_contact->metaContactId().toString());
}
}
......@@ -80,8 +80,8 @@ void ContactStalker::messageAppended(Kopete::Message &message,
}
if ( message.direction() == Kopete::Message::Inbound ) {
QString contactId = message.from()->metaContact()->metaContactId();
if (contactId == m_contact->metaContactId())
QString contactId = message.from()->metaContact()->metaContactId().toString();
if (contactId == m_contact->metaContactId().toString())
{
foreach(Kopete::Contact *subContact, m_contact->contacts())
{
......@@ -102,7 +102,7 @@ void ContactStalker::slotMetaContactRemoved(Kopete::MetaContact *contact)
if (contact == m_contact)
{
m_contact = 0L;
emit contactChanged(contact->metaContactId());
emit contactChanged(contact->metaContactId().toString());
}
}
......@@ -135,7 +135,7 @@ QStringList KopeteDBusInterfacePrivate::listContact(const QList<
foreach(Kopete::MetaContact *contact, contactList)
{
result << contact->metaContactId();
result << contact->metaContactId().toString();
}
return result;
......
......@@ -48,7 +48,7 @@ void KopeteIdentityStatusBarIcon::mousePressEvent( QMouseEvent *me )
KActionMenu *statusMenu = new KActionMenu(m_identity->label(), this);
// add a title to the popup menu before the online action
statusMenu->menu()->addTitle(m_identity->label());
statusMenu->menu()->addSection(m_identity->label());
// Will be automatically deleted when the statusMenu is deleted.
Kopete::StatusRootAction* statusAction = new Kopete::StatusRootAction( statusMenu );
......
......@@ -22,23 +22,25 @@
#include "kopetewindow.h"
#include <QUrl>
#include <QIcon>
#include <QMenu>
#include <QTimer>
#include <QEvent>
#include <QLabel>
#include <QAction>
#include <QCursor>
#include <QLayout>
#include <QTimer>
#include <QPixmap>
#include <QLineEdit>
#include <QTextEdit>
#include <QCloseEvent>
#include <QMouseEvent>
#include <QEvent>
#include <QLabel>
#include <QShowEvent>
#include <QLineEdit>
#include <QSignalMapper>
#include <QTextEdit>
#include <khbox.h>
#include <kvbox.h>
#include <QAction>
#include <kactionmenu.h>
#include <kactioncollection.h>
#include <ktoggleaction.h>
......@@ -46,11 +48,9 @@
#include <kdebug.h>
#include <kglobalaccel.h>
#include <klocale.h>
#include <QIcon>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <knotifyconfigwidget.h>
#include <QMenu>
#include <kshortcutsdialog.h>
#include <kedittoolbar.h>
#include <kmenubar.h>
......@@ -61,7 +61,6 @@
#include <kplugininfo.h>
#include <ksqueezedtextlabel.h>
#include <kstringhandler.h>
#include <QUrl>
#include <kxmlguifactory.h>
#include <ktoolbar.h>
#include <kdialog.h>
......@@ -590,7 +589,7 @@ bool KopeteWindow::eventFilter ( QObject* target, QEvent* event )
void KopeteWindow::loadOptions()
{
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
toolBar ( "mainToolBar" )->applySettings ( config->group ( "ToolBar Settings" ) );
toolBar ( "quickSearchBar" )->applySettings ( config->group ( "QuickSearchBar Settings" ) );
......@@ -629,12 +628,12 @@ void KopeteWindow::loadOptions()
void KopeteWindow::saveOptions()
{
KConfigGroup mainToolbarGroup ( KGlobal::config(), "ToolBar Settings" );
KConfigGroup mainToolbarGroup ( KSharedConfig::openConfig(), "ToolBar Settings" );
toolBar ( "mainToolBar" )->saveSettings ( mainToolbarGroup );
KConfigGroup qsbGroup ( KGlobal::config(), "QuickSearchBar Settings" );
KConfigGroup qsbGroup ( KSharedConfig::openConfig(), "QuickSearchBar Settings" );
toolBar ( "quickSearchBar" )->saveSettings ( qsbGroup );
KConfigGroup cg ( KGlobal::config(), "General Options" );
KConfigGroup cg ( KSharedConfig::openConfig(), "General Options" );
saveMainWindowSettings ( cg );
cg.writeEntry ( "Position", pos() );
......@@ -778,7 +777,7 @@ void KopeteWindow::slotConfGlobalKeys()
void KopeteWindow::slotConfToolbar()
{
KConfigGroup cg ( KGlobal::config(), "General Options" );
KConfigGroup cg ( KSharedConfig::openConfig(), "General Options" );
saveMainWindowSettings ( cg );
KEditToolBar *dlg = new KEditToolBar ( factory() );
connect ( dlg, SIGNAL (newToolBarConfig()), this, SLOT (slotUpdateToolbar()) );
......@@ -788,7 +787,7 @@ void KopeteWindow::slotConfToolbar()
void KopeteWindow::slotUpdateToolbar()
{
applyMainWindowSettings ( KGlobal::config()->group ( "General Options" ) );
applyMainWindowSettings ( KSharedConfig::openConfig()->group ( "General Options" ) );
}
void KopeteWindow::slotGlobalAway()
......@@ -936,7 +935,7 @@ void KopeteWindow::slotAllPluginsLoaded()
// actionConnect->setEnabled(true);
d->actionDisconnect->setEnabled ( true );
KConfigGroup cg( KGlobal::config(), "General Options" );
KConfigGroup cg( KSharedConfig::openConfig(), "General Options" );
// If some account already loaded, build the status icon
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
......
......@@ -19,14 +19,18 @@
#include "systemtray.h"
#include <qtimer.h>
#include <QMenu>
#include <QTimer>
#include <QAction>
#include <KDebug>
#include <KLocale>
#include <KGlobal>
#include <K4AboutData>
#include <kactioncollection.h>
#include <QAction>
#include <QMenu>
#include <klocale.h>
#include <kdebug.h>
#include <KComponentData>
#include <KLocalizedString>
#include <KActionCollection>
#include "kopetechatsessionmanager.h"
#include "kopetebehaviorsettings.h"
#include "kopetemetacontact.h"
......@@ -78,7 +82,10 @@ KopeteSystemTray::KopeteSystemTray(QWidget* parent)
// in the close widget click case, we only want to hide the parent window
// so instead, we make it call our general purpose quit slot on the window, which causes a window close and everything else we need
// KDE4 - app will have to listen for quitSelected instead
QAction *quit = actionCollection()->action( "file_quit" );
QList<QAction *> actionList = actionCollection();
KActionCollection *newActionList = new KActionCollection(parent);
newActionList->addActions(actionList);
QAction *quit = newActionList->action( "file_quit" );
quit->disconnect();
KopeteWindow *myParent = static_cast<KopeteWindow *>( parent );