* small build changes

* drop cast (they were added to try to avoid possible crash)
This commit is contained in:
arcan1s 2015-10-06 06:49:24 +03:00
parent c4612d84ed
commit 69c1f0ed5a
13 changed files with 26 additions and 31 deletions

View File

@ -8,7 +8,7 @@ ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build
Build Type=Debug
Build Type=Release
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=

View File

@ -17,8 +17,8 @@ set(PROJECT_VERSION_MAJOR "2")
set(PROJECT_VERSION_MINOR "4")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "")
# append git version if any
set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "")
include(checkgit.cmake)
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
@ -34,7 +34,7 @@ option(BUILD_DEB_PACKAGE "Build deb package" OFF)
option(BUILD_RPM_PACKAGE "Build rpm package" OFF)
# build details
option(BUILD_FUTURE "Build with the features which will be marked as stable later" OFF)
option(BUILD_TEST "Build with additional test abilities" OFF)
option(BUILD_TESTING "Build with additional test abilities" OFF)
# flags
if(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -57,8 +57,8 @@ void AWDataEngineAggregator::connectVisualization()
{
qCDebug(LOG_AW);
connect(this, SIGNAL(updateData(QString, QVariantHash)),
parent(), SLOT(dataUpdated(QString, QVariantHash)));
connect(this, SIGNAL(updateData(QString, QVariantMap)),
parent(), SLOT(dataUpdated(QString, QVariantMap)));
return static_cast<AWKeys *>(parent())->unlock();
}
@ -68,8 +68,8 @@ void AWDataEngineAggregator::disconnectVisualization()
{
qCDebug(LOG_AW);
disconnect(this, SIGNAL(updateData(QString, QVariantHash)),
parent(), SLOT(dataUpdated(QString, QVariantHash)));
disconnect(this, SIGNAL(updateData(QString, QVariantMap)),
parent(), SLOT(dataUpdated(QString, QVariantMap)));
return QTimer::singleShot(5 * m_interval, this, SLOT(connectVisualization()));
}
@ -101,7 +101,7 @@ void AWDataEngineAggregator::dataUpdated(const QString sourceName, const Plasma:
qCDebug(LOG_AW) << "Source" << sourceName;
qCDebug(LOG_AW) << "Data" << data;
return emit(updateData(QString(sourceName), qvariant_cast<QVariantHash>(data)));
return emit(updateData(sourceName, data));
}

View File

@ -35,7 +35,7 @@ public:
void setInterval(const int _interval);
signals:
void updateData(const QString sourceName, const QVariantHash sdata);
void updateData(const QString sourceName, const QVariantMap sdata);
public slots:
// additional methods to control this and visualization

View File

@ -85,6 +85,7 @@ void AWKeys::unlock()
{
qCDebug(LOG_AW);
qCWarning(LOG_AW) << "Unlock stream";
lock = false;
}
@ -404,7 +405,7 @@ void AWKeys::addDevice(const QString source)
}
void AWKeys::dataUpdated(const QString sourceName, const QVariantHash data)
void AWKeys::dataUpdated(const QString sourceName, const QVariantMap data)
{
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << sourceName;
@ -699,7 +700,7 @@ QString AWKeys::parsePattern(QString pattern) const
}
void AWKeys::setDataBySource(const QString sourceName, const QVariantHash data)
void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data)
{
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << sourceName;

View File

@ -60,7 +60,7 @@ public:
public slots:
void addDevice(const QString source);
void dataUpdated(const QString sourceName, const QVariantHash data);
void dataUpdated(const QString sourceName, const QVariantMap data);
signals:
void dropSourceFromDataengine(const QString source);
@ -78,7 +78,7 @@ private:
void addKeyToCache(const QString type, const QString key = QString(""));
void calculateValues();
QString parsePattern(QString pattern) const;
void setDataBySource(const QString sourceName, const QVariantHash data);
void setDataBySource(const QString sourceName, const QVariantMap data);
// objects
AWDataAggregator *dataAggregator = nullptr;
AWDataEngineAggregator *dataEngineAggregator = nullptr;

View File

@ -26,10 +26,8 @@ file(RELATIVE_PATH SUBPROJECT_WEATHER_JSON ${CMAKE_SOURCE_DIR} ${SUBPROJECT_WEAT
# prepare
configure_file(${SUBPROJECT_WEATHER_JSON_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_WEATHER_JSON})
qt5_wrap_cpp(SUBPROJECT_MOC_SOURCE ${SUBPROJECT_HEADER})
qt5_wrap_ui(SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
add_library(${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_MOC_SOURCE}
${SUBPROJECT_HEADER} ${SUBPROJECT_UI_HEADER})
add_library(${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER} ${SUBPROJECT_UI_HEADER})
target_link_libraries(${SUBPROJECT} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
# install

View File

@ -47,10 +47,8 @@ AbstractExtItem::~AbstractExtItem()
template <class T>
T *AbstractExtItem::copy(const QString _fileName, const int _number)
T *AbstractExtItem::copy(const QString, const int)
{
Q_UNUSED(_fileName)
Q_UNUSED(_number)
qCDebug(LOG_LIB);
// an analog of pure virtual method

View File

@ -39,7 +39,7 @@ public:
explicit AbstractExtItem(QWidget *parent = nullptr, const QString desktopName = QString(),
const QStringList directories = QStringList());
virtual ~AbstractExtItem();
template <class T> T *copy(const QString _fileName, const int _number);
template <class T> T *copy(const QString, const int);
// get methods
int apiVersion() const;
QString comment() const;

View File

@ -1,5 +1,4 @@
set(SUBPROJECT plasma_dataengine_extsysmon)
set(PLUGIN_NAME ${SUBPROJECT})
message(STATUS "Subproject ${SUBPROJECT}")
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.awesomewidget\")
@ -26,13 +25,12 @@ configure_file(${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT
# make
qt5_wrap_cpp(TASK_MOC_SOURCE ${TASK_HEADER})
qt5_wrap_ui(SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
add_library(${PLUGIN_NAME} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER} ${TASK_MOC_SOURCE})
target_link_libraries(${PLUGIN_NAME} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
kcoreaddons_desktop_to_json(${PLUGIN_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
add_library(${SUBPROJECT} MODULE ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE})
target_link_libraries(${SUBPROJECT} ${PROJECT_LIBRARY} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
kcoreaddons_desktop_to_json(${SUBPROJECT} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
# install
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine)
install(TARGETS ${SUBPROJECT} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES ${SUBPROJECT_INI} DESTINATION ${CONFIG_INSTALL_DIR})

View File

@ -154,10 +154,10 @@ void ExtSysMonAggregator::init(const QHash<QString, QString> config)
AbstractExtSysMonSource *weatherItem = new WeatherSource(this, QStringList());
foreach(QString source, weatherItem->sources())
m_map[source] = weatherItem;
#ifdef BUILD_TEST
#ifdef BUILD_TESTING
// additional load source
AbstractExtSysMonSource *loadItem = new LoadSource(this, QStringList());
foreach(QString source, loadItem->sources())
m_map[source] = loadItem;
#endif /* BUILD_TEST */
#endif /* BUILD_TESTING */
}

View File

@ -1,4 +1,4 @@
# required by translation packae
# required by translation package
find_package(Gettext REQUIRED)
# main qt libraries

View File

@ -25,7 +25,7 @@
// available time keys
#define TIME_KEYS "dddd,ddd,dd,d,MMMM,MMM,MM,M,yyyy,yy,hh,h,HH,H,mm,m,ss,s,t,ap,a,AP,A"
#cmakedefine BUILD_FUTURE
#cmakedefine BUILD_TEST
#cmakedefine BUILD_TESTING
// links
#define HOMEPAGE "https://arcanis.name/projects/awesome-widgets/"
@ -50,6 +50,6 @@
#define BUILD_RPM_PACKAGE "@BUILD_RPM_PACKAGE@"
// additional functions
#define PROP_FUTURE "@BUILD_FUTURE@"
#define PROP_TEST "@BUILD_TEST@"
#define PROP_TEST "@BUILD_TESTING@"
#endif /* VERSION_H */