From 301ab9319612202a8c90972f66d1d3f505ac24fb Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 19 Jul 2007 22:27:45 +0000 Subject: [PATCH] Riactivate the very very very, and I underline very, experimental newstuff support we had before the KNS1 -> KNS2 switch: - install a newstuff rc config, pointing to the NS1 stuff on okular.kde.org - show the download dialog for newstuff, properly (hopefully) initialized - proper linking for the okularpart svn path=/trunk/KDE/kdegraphics/okular/; revision=690047 --- CMakeLists.txt | 2 +- part.cpp | 14 +++++--------- ui/data/CMakeLists.txt | 5 +++++ ui/data/okular.knsrc | 2 ++ 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 ui/data/okular.knsrc diff --git a/CMakeLists.txt b/CMakeLists.txt index e8512bc7d..85c84c44e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,7 +150,7 @@ kde4_add_ui_files(okularpart_SRCS kde4_add_plugin(okularpart WITH_PREFIX ${okularpart_SRCS}) -target_link_libraries(okularpart okularcore ${KDE4_KNEWSTUFF_LIBS} ${KDE4_KHTML_LIBS} ${MATH_LIB}) +target_link_libraries(okularpart okularcore ${KDE4_KPARTS_LIBS} ${KDE4_KNEWSTUFF2_LIBS} ${MATH_LIB}) install(TARGETS okularpart DESTINATION ${PLUGIN_INSTALL_DIR}) diff --git a/part.cpp b/part.cpp index 322632fae..5b1216bee 100644 --- a/part.cpp +++ b/part.cpp @@ -53,6 +53,7 @@ #include #include #include +#include // local includes #include "aboutdata.h" @@ -62,9 +63,6 @@ #include "ui/thumbnaillist.h" #include "ui/side_reviews.h" #include "ui/minibar.h" -#if 0 -#include "ui/newstuff.h" -#endif #include "ui/embeddedfilesdialog.h" #include "ui/propertiesdialog.h" #include "ui/presentationwidget.h" @@ -1202,13 +1200,11 @@ void Part::slotSaveFileAs() void Part::slotGetNewStuff() { -#if 0 + KNS::Engine engine; + engine.init( "okular.knsrc" ); // show the modal dialog over pageview and execute it - NewStuffDialog * dialog = new NewStuffDialog( m_pageView ); - connect ( dialog , SIGNAL ( loadItemClicked( const KUrl & ) ), this , SLOT ( openUrlFromDocument ( const KUrl & ) ) ); - dialog->exec(); - delete dialog; -#endif + KNS::Entry::List entries = engine.downloadDialogModal( m_pageView ); + Q_UNUSED( entries ) } diff --git a/ui/data/CMakeLists.txt b/ui/data/CMakeLists.txt index e7c2c8c0a..db65f056b 100644 --- a/ui/data/CMakeLists.txt +++ b/ui/data/CMakeLists.txt @@ -37,3 +37,8 @@ install(FILES ghns_star_gray.png DESTINATION ${DATA_INSTALL_DIR}/okular/pics) +# newstuff +install(FILES + okular.knsrc + DESTINATION ${CONFIG_INSTALL_DIR}) + diff --git a/ui/data/okular.knsrc b/ui/data/okular.knsrc new file mode 100644 index 000000000..bcd121342 --- /dev/null +++ b/ui/data/okular.knsrc @@ -0,0 +1,2 @@ +[KNewStuff2] +ProvidersUrl=http://okular.kde.org/newstuff/providers.xml