Editable stage history, auto-ghosting, and an Add-form fix
Stage history editor: - The edit form's Pipeline section is now the application's history: one row per step (stage + date), Add Step and Remove Step, kept in date order. The last step is the current stage and the first step's date the date applied, replacing the separate Stage and Date Applied fields. An application logged after the fact (applied, interviewed, rejected) keeps its whole path. - JobsDatabase::replaceStageHistory() rewrites a job's history in one transaction (sorted, repeats collapsed, stage and date applied kept in step); StageHistoryModel backs the section; JobsModel::addJob() now returns the new id so a new application's history can be saved. - `kareer history <id> [Stage=YYYY-MM-DD ...]` shows or replaces it. Auto-ghosting: - Applications still at Applied with no activity (the later of the date applied and the last stage change) for more than 30 days move to Ghosted, recorded like any stage change. Runs at startup for GUI and CLI, after switching databases, and shortly after the setting changes. - Preferences gains an Applications section: on/off and the number of days (kareerrc [AutoGhost]). The GUI shows a passive notification; the CLI notes it on stderr so --json output stays clean. Fixes: - The Add Application form pre-filled empty text fields with the word "undefined" (typing "a" gave "undefineda"): fields with no value reached QML as undefined. Every field now gets a typed default. - Embed the app icon as the window icon fallback, so the window and About page show it when running uninstalled. Tests: history replacement and the after-the-fact Allstate case, the ghosting rules (fresh/stale/logged-late/reopened/threshold), and empty new-form fields. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BxDf7HqD1xPnsZP8wt3NTk
This commit is contained in:
+9
-1
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "kareer-version.h"
|
||||
|
||||
#include "autoghost.h"
|
||||
#include "clicommands.h"
|
||||
#include "databaselocation.h"
|
||||
#include "jobsdatabase.h"
|
||||
@@ -110,6 +111,10 @@ int main(int argc, char *argv[])
|
||||
if (argc >= 2 && Cli::isSubcommand(QString::fromLocal8Bit(argv[1]))) {
|
||||
QCoreApplication app(argc, argv);
|
||||
DatabaseLocation::loadConfiguredPath();
|
||||
if (const int ghosted = AutoGhost::runNow(); ghosted > 0) {
|
||||
// stderr, so --json output on stdout stays machine-readable.
|
||||
fprintf(stderr, "kareer: marked %d application(s) with no response as Ghosted\n", ghosted);
|
||||
}
|
||||
return Cli::run(app);
|
||||
}
|
||||
|
||||
@@ -134,7 +139,7 @@ int main(int argc, char *argv[])
|
||||
aboutData.setDesktopFileName(u"io.github.toservetheking.Kareer"_s);
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
|
||||
QApplication::setWindowIcon(QIcon::fromTheme(u"io.github.toservetheking.Kareer"_s, QIcon::fromTheme(u"office-address-book"_s)));
|
||||
QApplication::setWindowIcon(QIcon::fromTheme(u"io.github.toservetheking.Kareer"_s, QIcon(u":/icons/sc-apps-io.github.toservetheking.Kareer.svg"_s)));
|
||||
|
||||
KCrash::initialize();
|
||||
|
||||
@@ -149,6 +154,9 @@ int main(int argc, char *argv[])
|
||||
// First run (or the configured file has gone missing): open nothing until
|
||||
// the user picks a location in DatabaseSetupDialog. The CLI never waits.
|
||||
JobsDatabase::setSelectionPending(DatabaseLocation::needsSetup());
|
||||
if (!JobsDatabase::selectionPending()) {
|
||||
AutoGhost::runNow(); // before the models load; Main.qml reports the count
|
||||
}
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
KLocalization::setupLocalizedContext(&engine);
|
||||
|
||||
Reference in New Issue
Block a user