From: Jean-Baptiste Mardelle Date: Fri, 30 Dec 2011 00:43:54 +0000 (+0100) Subject: Compile without QJson, require Solid for network connectivity awareness X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4aa1d01dad09550d3b44f9f1a9e171b0e9745469;p=kdenlive Compile without QJson, require Solid for network connectivity awareness --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f39ee5c9..915c1c4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,9 +69,10 @@ macro_log_feature(QJSON_FOUND "http://qjson.sourceforge.net" FALSE "" - "Required to build the rotoscoping filter" + "Required to build the rotoscoping filter and for Freesound.org queries" ) + add_subdirectory(audioscopes) add_subdirectory(beziercurve) add_subdirectory(blackmagic) @@ -316,6 +317,7 @@ target_link_libraries(kdenlive ${KDE4_KNEWSTUFF_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY} ${KDE4_KROSSUI_LIBS} + ${KDE4_SOLID_LIBS} ${QT_LIBRARIES} ${LIBMLT_LIBRARY} ${LIBMLTPLUS_LIBRARY} diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index f420ed43..00e9eddf 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -3,3 +3,5 @@ set(kdenlive_SRCS utils/freesound.cpp PARENT_SCOPE ) + + diff --git a/src/utils/freesound.cpp b/src/utils/freesound.cpp index f18fa41e..1ac1b2a7 100644 --- a/src/utils/freesound.cpp +++ b/src/utils/freesound.cpp @@ -33,9 +33,12 @@ #include #include #include +#include #include +#ifdef USE_QJSON #include +#endif const int imageRole = Qt::UserRole; const int urlRole = Qt::UserRole + 1; @@ -55,7 +58,9 @@ FreeSound::FreeSound(const QString & folder, QWidget * parent) : setFont(KGlobalSettings::toolBarFont()); setupUi(this); setAttribute(Qt::WA_DeleteOnClose); +#ifdef USE_QJSON service_list->addItem(i18n("Freesound Audio Library"), FREESOUND); +#endif service_list->addItem(i18n("Open Clip Art Graphic Library"), OPENCLIPART); setWindowTitle(i18n("Search Online Resources")); connect(button_search, SIGNAL(clicked()), this, SLOT(slotStartSearch())); @@ -68,6 +73,11 @@ FreeSound::FreeSound(const QString & folder, QWidget * parent) : connect(m_previewProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotPreviewStatusChanged(QProcess::ProcessState))); connect(service_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotChangeService())); sound_image->setFixedWidth(180); + if (Solid::Networking::status() == Solid::Networking::Unconnected) { + slotOffline(); + } + connect(Solid::Networking::notifier(), SIGNAL(shouldConnect()), this, SLOT(slotOnline())); + connect(Solid::Networking::notifier(), SIGNAL(shouldDisconnect()), this, SLOT(slotOffline())); } FreeSound::~FreeSound() @@ -109,6 +119,7 @@ void FreeSound::slotShowResults() search_results->blockSignals(true); search_results->clear(); if (m_service == FREESOUND) { +#ifdef USE_QJSON QJson::Parser parser; bool ok; //kDebug()<<"// GOT RESULT: "<text().isEmpty()) slotStartSearch(); } +void FreeSound::slotOnline() +{ + button_search->setEnabled(true); + search_info->setText(QString()); +} + +void FreeSound::slotOffline() +{ + button_search->setEnabled(false); + search_info->setText(i18n("You need to be online\n for searching")); +} + diff --git a/src/utils/freesound.h b/src/utils/freesound.h index c81a34b4..297dfccc 100644 --- a/src/utils/freesound.h +++ b/src/utils/freesound.h @@ -50,6 +50,8 @@ private slots: void slotSaveSound(); void slotOpenUrl(const QString &url); void slotChangeService(); + void slotOnline(); + void slotOffline(); private: QString m_folder;