Index: kopete.knsrc
===================================================================
--- kopete.knsrc (revision 0)
+++ kopete.knsrc (revision 0)
-0,0 +1,4 @@
+[KNewStuff3]
+ProvidersUrl=http://download.kde.org/ocs/providers.xml
+Categories=Kopete Styles 0.12+
+TargetDir=kopete_chatstyles
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 1097398)
+++ CMakeLists.txt (working copy)
-21,7 +21,7 @@
kde4_add_plugin(kcm_kopete_chatwindowconfig ${kcm_kopete_chatwindowconfig_PART_SRCS})
-target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF2_LIBS} ${KDE4_KHTML_LIBS})
+target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF3_LIBS} ${KDE4_KHTML_LIBS})
install(TARGETS kcm_kopete_chatwindowconfig DESTINATION ${PLUGIN_INSTALL_DIR})
-29,5 +29,5 @@
########### install files ###############
install( FILES kopete_chatwindowconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install( FILES kopete.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
-
Index: chatwindowconfig.cpp
===================================================================
--- chatwindowconfig.cpp (revision 1097398)
+++ chatwindowconfig.cpp (working copy)
-53,7 +53,7 @@
#include <KCMultiDialog>
// KNewStuff
-#include <knewstuff2/engine.h>
+#include <knewstuff3/downloaddialog.h>
// For Kopete Chat Window Style configuration and preview.
#include <kopetechatwindowstylemanager.h>
-476,32 +476,22 @@
void ChatWindowConfig::slotGetChatStyles()
{
- KConfigGroup configGrp(KGlobal::config(), "KNewStuff2");
- configGrp.writeEntry("ProvidersUrl", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml");
- configGrp.writeEntry("TargetDir", "kopete_chatstyles");
- configGrp.sync();
-
- KNS::Engine *engine = new KNS::Engine();
- engine->init(configGrp.config()->name());
-
- // 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());
+ KNS3::DownloadDialog dialog("kopete.knsrc", this);
+ dialog.exec();
- KNS::Entry::List entries = engine->downloadDialogModal(this);
+ KNS3::Entry::List entries = dialog.changedEntries();
if ( entries.size() > 0 )
{
int correctlyInstalled(0);
- foreach( KNS::Entry* entry, entries )
+ foreach( const KNS3::Entry& entry, entries )
{
- if ( entry->status() == KNS::Entry::Installed && entry->installedFiles().size() > 0 )
+ if ( entry.status() == KNS3::Entry::Installed && entry.installedFiles().size() > 0 )
{
- KUrl styleFile( entry->installedFiles().at(0) );
+ KUrl styleFile( entry.installedFiles().at(0) );
int result = installChatStyle( styleFile );
- QString packageName(entry->name().representation());
+ QString packageName(entry.name());
QString errorTitle = i18nc("@title:window", "Chat Window Style <resource>%1</resource> installation", packageName);
switch(result)
{
-538,8 +528,6 @@
KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18np("One Chat Window Style package has been installed.", "%1 Chat Window Style packages have been installed.", correctlyInstalled));
}
}
-
- delete engine;
}
void ChatWindowConfig::createPreviewChatSession()
-714,11 +702,6 @@
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());
-
KCMultiDialog *kcm = new KCMultiDialog( this );
kcm->setCaption( i18n( "Configure Emoticon Themes" ) );
kcm->addModule( "emoticons" );