Don't like ads? PRO users don't see any ads ;-)
Guest

Hans

By: a guest on Mar 2nd, 2010  |  syntax: C++  |  size: 4.14 KB  |  hits: 183  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: kopete.knsrc
  2. ===================================================================
  3. --- kopete.knsrc        (revision 0)
  4. +++ kopete.knsrc        (revision 0)
  5.  -0,0 +1,4 @@
  6. +[KNewStuff3]
  7. +ProvidersUrl=http://download.kde.org/ocs/providers.xml
  8. +Categories=Kopete Styles 0.12+
  9. +TargetDir=kopete_chatstyles
  10. Index: CMakeLists.txt
  11. ===================================================================
  12. --- CMakeLists.txt      (revision 1097398)
  13. +++ CMakeLists.txt      (working copy)
  14.  -21,7 +21,7 @@
  15.  kde4_add_plugin(kcm_kopete_chatwindowconfig ${kcm_kopete_chatwindowconfig_PART_SRCS})
  16.  
  17.  
  18. -target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF2_LIBS} ${KDE4_KHTML_LIBS})
  19. +target_link_libraries(kcm_kopete_chatwindowconfig ${KDE4_KUTILS_LIBS} kopete kopetechatwindow_shared ${KDE4_KNEWSTUFF3_LIBS} ${KDE4_KHTML_LIBS})
  20.  
  21.  install(TARGETS kcm_kopete_chatwindowconfig DESTINATION ${PLUGIN_INSTALL_DIR})
  22.  
  23.  -29,5 +29,5 @@
  24.  ########### install files ###############
  25.  
  26.  install( FILES kopete_chatwindowconfig.desktop  DESTINATION ${SERVICES_INSTALL_DIR})
  27. +install( FILES kopete.knsrc DESTINATION  ${CONFIG_INSTALL_DIR})
  28.  
  29. -
  30. Index: chatwindowconfig.cpp
  31. ===================================================================
  32. --- chatwindowconfig.cpp        (revision 1097398)
  33. +++ chatwindowconfig.cpp        (working copy)
  34.  -53,7 +53,7 @@
  35.  #include <KCMultiDialog>
  36.  
  37.  // KNewStuff
  38. -#include <knewstuff2/engine.h>
  39. +#include <knewstuff3/downloaddialog.h>
  40.  
  41.  // For Kopete Chat Window Style configuration and preview.
  42.  #include <kopetechatwindowstylemanager.h>
  43.  -476,32 +476,22 @@
  44.  
  45.  void ChatWindowConfig::slotGetChatStyles()
  46.  {
  47. -       KConfigGroup configGrp(KGlobal::config(), "KNewStuff2");
  48. -       configGrp.writeEntry("ProvidersUrl", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml");
  49. -       configGrp.writeEntry("TargetDir", "kopete_chatstyles");
  50. -       configGrp.sync();
  51. -      
  52. -       KNS::Engine *engine = new KNS::Engine();
  53. -       engine->init(configGrp.config()->name());
  54. -      
  55. -       // FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
  56. -       // the settings dialog there is no active valid KComponentData, which KNS2 relies on.
  57. -       // Forcing an active one below works around bug 163382, but the problem is somewhere else.
  58. -       KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
  59. +       KNS3::DownloadDialog dialog("kopete.knsrc", this);
  60. +       dialog.exec();
  61.  
  62. -       KNS::Entry::List entries = engine->downloadDialogModal(this);
  63. +       KNS3::Entry::List entries = dialog.changedEntries();
  64.  
  65.         if ( entries.size() > 0 )
  66.         {
  67.                 int correctlyInstalled(0);
  68. -               foreach( KNS::Entry* entry, entries )
  69. +               foreach( const KNS3::Entry& entry, entries )
  70.                 {
  71. -                       if ( entry->status() == KNS::Entry::Installed && entry->installedFiles().size() > 0 )
  72. +                       if ( entry.status() == KNS3::Entry::Installed && entry.installedFiles().size() > 0 )
  73.                         {
  74. -                               KUrl styleFile( entry->installedFiles().at(0) );
  75. +                               KUrl styleFile( entry.installedFiles().at(0) );
  76.                                 int result = installChatStyle( styleFile );
  77.  
  78. -                               QString packageName(entry->name().representation());
  79. +                               QString packageName(entry.name());
  80.                                 QString errorTitle = i18nc("@title:window", "Chat Window Style <resource>%1</resource> installation", packageName);
  81.                                 switch(result)
  82.                                 {
  83.  -538,8 +528,6 @@
  84.                         KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18np("One Chat Window Style package has been installed.", "%1 Chat Window Style packages have been installed.", correctlyInstalled));
  85.                 }
  86.         }
  87. -
  88. -       delete engine;
  89.  }
  90.  
  91.  void ChatWindowConfig::createPreviewChatSession()
  92.  -714,11 +702,6 @@
  93.  
  94.  void ChatWindowConfig::slotManageEmoticonThemes()
  95.  {
  96. -       // FIXME: Upon closing the Settings KCMultiDialog all KCMs are deleted and when reopening
  97. -       // the settings dialog there is no active valid KComponentData, which KNS2 relies on.
  98. -       // Forcing an active one below works around bug 165919, but the problem is somewhere else.
  99. -       KGlobal::setActiveComponent(KopeteChatWindowConfigFactory::componentData());
  100. -
  101.         KCMultiDialog *kcm = new KCMultiDialog( this );
  102.         kcm->setCaption( i18n( "Configure Emoticon Themes" ) );
  103.         kcm->addModule( "emoticons" );