Skip to content

Commit

Permalink
Add cmake NEXTCLOUD_DEV so debug client can run in parallel to releas…
Browse files Browse the repository at this point in the history
…e client.

- Defaults to OFF.
- Allows to use QTextStream for logs.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan authored and mgallien committed Feb 21, 2024
1 parent 373d6d0 commit 98fe147
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ option(BUILD_GUI "BUILD_GUI" ON)
# build the tests
option(BUILD_TESTING "BUILD_TESTING" ON)

# allows to run nextclouddev in parallel to nextcloud + logs
option(NEXTCLOUD_DEV "NEXTCLOUD_DEV" OFF)

option(ENABLE_CLANG_TIDY "ENABLE_CLANG_TIDY" OFF)
if(ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
Expand Down
21 changes: 14 additions & 7 deletions NEXTCLOUD.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
set( APPLICATION_NAME "Nextcloud" )
set( APPLICATION_SHORTNAME "Nextcloud" )
set( APPLICATION_EXECUTABLE "nextcloud" )
if(NEXTCLOUD_DEV)
set( APPLICATION_NAME "NextcloudDev" )
set( APPLICATION_SHORTNAME "NextDev" )
set( APPLICATION_EXECUTABLE "nextclouddev" )
set( APPLICATION_ICON_NAME "Nextcloud" )
else()
set( APPLICATION_NAME "Nextcloud" )
set( APPLICATION_SHORTNAME "Nextcloud" )
set( APPLICATION_EXECUTABLE "nextcloud" )
set( APPLICATION_ICON_NAME "${APPLICATION_SHORTNAME}" )
endif()

set( APPLICATION_CONFIG_NAME "${APPLICATION_EXECUTABLE}" )
set( APPLICATION_DOMAIN "nextcloud.com" )
set( APPLICATION_VENDOR "Nextcloud GmbH" )
set( APPLICATION_UPDATE_URL "https://updates.nextcloud.org/client/" CACHE STRING "URL for updater" )
set( APPLICATION_HELP_URL "" CACHE STRING "URL for the help menu" )

if(APPLE AND APPLICATION_NAME STREQUAL "Nextcloud" AND EXISTS "${CMAKE_SOURCE_DIR}/theme/colored/Nextcloud-macOS-icon.svg")
set( APPLICATION_ICON_NAME "Nextcloud-macOS" )
message("Using macOS-specific application icon: ${APPLICATION_ICON_NAME}")
else()
set( APPLICATION_ICON_NAME "${APPLICATION_SHORTNAME}" )
set( APPLICATION_ICON_NAME "Nextcloud-macOS${DEV}" )
message("Using macOS-specific application icon: ${APPLICATION_ICON_NAME}${DEV}")
endif()

set( APPLICATION_ICON_SET "SVG" )
Expand Down
4 changes: 4 additions & 0 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString
msgW.append(L"\n");
OutputDebugString(msgW.c_str());
}
#endif
#if defined(NEXTCLOUD_DEV)
QTextStream cout(stdout, QIODevice::WriteOnly);
cout << msg << endl;
#endif
{
QMutexLocker lock(&_mutex);
Expand Down

0 comments on commit 98fe147

Please sign in to comment.