Skip to content

Commit

Permalink
fix: Version not match when build outside dde-dock project
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Apr 27, 2018
1 parent 8c82557 commit 8b7fd3c
Show file tree
Hide file tree
Showing 7 changed files with 711 additions and 8 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@

set(PLUGIN_NAME "pineappledatetime")
# set(CMAKE_VERBOSE_MAKEFILE 1)


project(${PLUGIN_NAME})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_FLAGS "-g -Wall")

# Sources files
file(GLOB SRCS "*.h" "*.cpp")
file(GLOB SRCS "*.h" "*.cpp" "/usr/include/dde-dock/*.h")

find_package(PkgConfig REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(DtkWidget REQUIRED)

add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
add_definitions("-DQT_PLUGIN ${QT_DEFINITIONS}")
add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc)
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ../../interfaces)
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} /usr/include/dde-dock)
target_link_libraries(${PLUGIN_NAME} PRIVATE
${Qt5DBus_LIBRARIES}
${DtkWidget_LIBRARIES}
Expand Down
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## dde-dock datetime plugin (modified version)

*Please notice that this is **NOT** an official project*

### Info

Simple quick hack to make it display year/month/day on it's `Dock::Efficient` mode (`24HourFormat` only). Also some really little simple tweak to make it compilable without fetching the full dde-dock repo.
Expand All @@ -10,7 +12,7 @@ Current codebase is fork from [dde-dock#39c1a6b](https://github.com/linuxdeepin/

You need do `apt-get build-dep dde-dock` first.

To compile:
To compile and run:

``` bash
# you should clone it first:
Expand All @@ -21,6 +23,16 @@ cd build/
cmake ../
make
# then you got `libpineappledatetime.so`
# this will copy this into `/usr/`
sudo make install
# this will copy this into `/usr/lib/dde-dock/plugins/`
# p.s. `make install` will copy the lib to `/usr/share/lib/dde-dock/plugins`
# but it seems `dde-dock` doesn't scan that path by default...
sudo cp ../libpineappledatetime.so /usr/lib/dde-dock/plugins/
# finally, restart `dde-dock` (kill it and dde will restart it automatically)
killall dde-dock
```

Then done!

### License

GPLv3 (as required, same as original license)
2 changes: 2 additions & 0 deletions datetimeplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <[email protected]>
* blumia <[email protected]>
*
* Maintainer: sbw <[email protected]>
* blumia <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
9 changes: 7 additions & 2 deletions datetimeplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <[email protected]>
* blumia <[email protected]>
*
* Maintainer: sbw <[email protected]>
* blumia <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -33,7 +35,7 @@ class DatetimePlugin : public QObject, PluginsItemInterface
{
Q_OBJECT
Q_INTERFACES(PluginsItemInterface)
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "datetime.json")
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "pineappledatetime.json")

public:
explicit DatetimePlugin(QObject *parent = 0);
Expand All @@ -43,7 +45,10 @@ class DatetimePlugin : public QObject, PluginsItemInterface
void init(PluginProxyInterface *proxyInter) override;

void pluginStateSwitched() override;
bool pluginIsAllowDisable() override { return true; }
bool pluginIsAllowDisable() override
{
return true;
}
bool pluginIsDisable() override;

int itemSortKey(const QString &itemKey);
Expand Down
2 changes: 2 additions & 0 deletions datetimewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <[email protected]>
* blumia <[email protected]>
*
* Maintainer: sbw <[email protected]>
* blumia <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
File renamed without changes.

0 comments on commit 8b7fd3c

Please sign in to comment.