Advertisement
Guest User

Mogger

a guest
Feb 22nd, 2010
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.71 KB | None | 0 0
  1. Index: CMakeLists.txt
  2. ===================================================================
  3. --- CMakeLists.txt  (revision 1094115)
  4. +++ CMakeLists.txt  (working copy)
  5. @@ -21,7 +21,7 @@
  6.  kde4_add_plugin(kcm_kopete_chatwindowconfig ${kcm_kopete_chatwindowconfig_PART_SRCS})
  7.  
  8.  
  9. -target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF2_LIBS} ${KDE4_KHTML_LIBS})
  10. +target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF3_LIBS} ${KDE4_KHTML_LIBS})
  11.  
  12.  install(TARGETS kcm_kopete_chatwindowconfig DESTINATION ${PLUGIN_INSTALL_DIR})
  13.  
  14. Index: chatwindowconfig.cpp
  15. ===================================================================
  16. --- chatwindowconfig.cpp    (revision 1094115)
  17. +++ chatwindowconfig.cpp    (working copy)
  18. @@ -53,7 +53,7 @@
  19.  #include <KCMultiDialog>
  20.  
  21.  // KNewStuff
  22. -#include <knewstuff2/engine.h>
  23. +#include <knewstuff3/downloaddialog.h>
  24.  
  25.  // For Kopete Chat Window Style configuration and preview.
  26.  #include <kopetechatwindowstylemanager.h>
  27. @@ -476,32 +476,27 @@
  28.  
  29.  void ChatWindowConfig::slotGetChatStyles()
  30.  {
  31. -   KConfigGroup configGrp(KGlobal::config(), "KNewStuff2");
  32. +   KConfigGroup configGrp(KGlobal::config(), "KNewStuff3");
  33.     configGrp.writeEntry("ProvidersUrl", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml");
  34.     configGrp.writeEntry("TargetDir", "kopete_chatstyles");
  35.     configGrp.sync();
  36. -  
  37. -   KNS::Engine *engine = new KNS::Engine();
  38. -   engine->init(configGrp.config()->name());
  39. -  
  40. -   // FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
  41. -   // the settings dialog there is no active valid KComponentData, which KNS2 relies on.
  42. -   // Forcing an active one below works around bug 163382, but the problem is somewhere else.
  43. -   KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
  44.  
  45. -   KNS::Entry::List entries = engine->downloadDialogModal(this);
  46. +   KNS3::DownloadDialog dialog(configGrp.config()->name(), this);
  47. +   dialog.exec();
  48.  
  49. +   KNS3::Entry::List entries = dialog.changedEntries();
  50. +
  51.     if ( entries.size() > 0 )
  52.     {
  53.         int correctlyInstalled(0);
  54. -       foreach( KNS::Entry* entry, entries )
  55. +       foreach( const KNS3::Entry& entry, entries )
  56.         {
  57. -           if ( entry->status() == KNS::Entry::Installed && entry->installedFiles().size() > 0 )
  58. +           if ( entry.status() == KNS3::Entry::Installed && entry.installedFiles().size() > 0 )
  59.             {
  60. -               KUrl styleFile( entry->installedFiles().at(0) );
  61. +               KUrl styleFile( entry.installedFiles().at(0) );
  62.                 int result = installChatStyle( styleFile );
  63.  
  64. -               QString packageName(entry->name().representation());
  65. +               QString packageName(entry.name());
  66.                 QString errorTitle = i18nc("@title:window", "Chat Window Style <resource>%1</resource> installation", packageName);
  67.                 switch(result)
  68.                 {
  69. @@ -538,8 +533,6 @@
  70.             KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18np("One Chat Window Style package has been installed.", "%1 Chat Window Style packages have been installed.", correctlyInstalled));
  71.         }
  72.     }
  73. -
  74. -   delete engine;
  75.  }
  76.  
  77.  void ChatWindowConfig::createPreviewChatSession()
  78. @@ -714,11 +707,6 @@
  79.  
  80.  void ChatWindowConfig::slotManageEmoticonThemes()
  81.  {
  82. -   // FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
  83. -   // the settings dialog there is no active valid KComponentData, which KNS2 relies on.
  84. -   // Forcing an active one below works around bug 165919, but the problem is somewhere else.
  85. -   KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
  86. -
  87.     KCMultiDialog *kcm = new KCMultiDialog( this );
  88.     kcm->setCaption( i18n( "Configure Emoticon Themes" ) );
  89.     kcm->addModule( "emoticons" );
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement