Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _codeql_detected_source_root
22 changes: 11 additions & 11 deletions qt_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,6 @@ set(TS_FILES
translations/app_fr.ts
)

# Create translation targets (Qt 6.2+)
if(COMMAND qt6_add_translations)
qt6_add_translations(${PROJECT_NAME}
TS_FILES ${TS_FILES}
RESOURCE_PREFIX "/translations"
)
else()
# Fallback for older Qt versions
qt_add_translation(QM_FILES ${TS_FILES})
endif()

# Create lib that will be reused everywhere
add_library(${PROJECT_NAME}_static_lib STATIC ${SOURCES} ${HEADERS})
target_link_libraries(${PROJECT_NAME}_static_lib PUBLIC
Expand Down Expand Up @@ -218,6 +207,17 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Concurrent
)

# Create translation targets (Qt 6.2+)
if(COMMAND qt6_add_translations)
qt6_add_translations(${PROJECT_NAME}
TS_FILES ${TS_FILES}
RESOURCE_PREFIX "/translations"
)
else()
# Fallback for older Qt versions
qt_add_translation(QM_FILES ${TS_FILES})
endif()

# Install rules
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION .
Expand Down
10 changes: 4 additions & 6 deletions qt_app/src/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ bool Database::initialize(const QString &dbPath)
return false;
}

// Run migrations if not in demo mode
if (!m_demoMode) {
if (!runMigrations()) {
qCritical() << "Failed to run migrations";
return false;
}
// Run migrations
if (!runMigrations()) {
qCritical() << "Failed to run migrations";
return false;
}

m_initialized = true;
Expand Down
16 changes: 16 additions & 0 deletions qt_app/tests/test_timeentrymanager.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#include <QtTest/QtTest>
#include "../include/managers/timeentrymanager.h"
#include "../include/database/database.h"
#include <QSqlQuery>

class TestTimeEntryManager : public QObject
{
Q_OBJECT

private slots:
void initTestCase()
{
Database* db = Database::instance();
db->setDemoMode(true);
QVERIFY(db->initialize());

// Create a test project
QSqlQuery query(db->database());
QVERIFY(query.exec("INSERT INTO projects (id, name, description, color) VALUES (1, 'Test Project', 'Test Description', '#FF0000')"));
}

void testTimerStartStop()
{
TimeEntryManager manager;
Expand All @@ -14,6 +27,9 @@ private slots:
QVERIFY(manager.startTimer(1, -1, "Test"));
QVERIFY(manager.timerRunning());

// Wait a bit so we have some elapsed time
QTest::qWait(100);

QVERIFY(manager.stopTimer());
QVERIFY(!manager.timerRunning());
}
Expand Down