From 4f6bf0f32483f524f2f654c9eaf9274d8e85af77 Mon Sep 17 00:00:00 2001 From: Louie S Date: Mon, 18 Mar 2024 15:16:01 -0400 Subject: Set settings with macro variables --- CMakeLists.txt | 1 + config.h.in | 1 + src/assignmentList.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fed72..4a87c05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5) project(assignment-list VERSION 0.0.1 LANGUAGES CXX) +set(ORGANIZATION_NAME "assignment-list-qt") set(PROJECT_TITLE "Assignment List") set(CMAKE_CXX_STANDARD 17) diff --git a/config.h.in b/config.h.in index f1add5e..889eef1 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,7 @@ #define PROJECT_NAME "@PROJECT_NAME@" #define PROJECT_TITLE "@PROJECT_TITLE@" +#define ORGANIZATION_NAME "@ORGANIZATION_NAME@" #define VERSION "@CMAKE_PROJECT_VERSION@" #define VERSION_MAJOR "@VERSION_MAJOR@" #define VERSION_MINOR "@VERSION_MINOR@" diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index c1e40f5..136af04 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -25,8 +25,8 @@ AssignmentList::AssignmentList() { // set QSettings information - QCoreApplication::setOrganizationName("assignment-list-qt"); // TODO grab this from a config.h type file - QCoreApplication::setApplicationName("assignment-list-qt"); // TODO grab this from a config.h type file + QCoreApplication::setOrganizationName(ORGANIZATION_NAME); + QCoreApplication::setApplicationName(PROJECT_NAME); // ensure QSettings location exists this->initializeSettings(); -- cgit