summaryrefslogtreecommitdiffstats
path: root/src/bmserver
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-12-22 08:48:13 +0100
committerjasplin <qt-info@nokia.com>2009-12-22 08:48:13 +0100
commit2e3f530038dc1167c2313218618c72777e0ac2f8 (patch)
tree65d63393604f3f8521335afa675defa301faa9a5 /src/bmserver
parentc963c20ed164635d9f41344b1fe95bbc1871b22c (diff)
Improved interactive context selection.
The context part of the configuration of a benchmark summary page may be interactively manipulated using HTML <select> menus for the individual components (metric, platform, host, and branch). This patch both speeds up the interactive selection and fixes a bug that caused the selection from going haywire (due to improper handling of asynchronous communication). This patch also involves a small visibility change: Rather than just hiding the non-matching options in each menu, all available values are now shown, but only the matching ones are selectable (i.e. enabled.). WARNING: Manipulating the disabled attribute of an <option> element doesn't seem to be supported by all web browsers.
Diffstat (limited to 'src/bmserver')
-rw-r--r--src/bmserver/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bmserver/main.cpp b/src/bmserver/main.cpp
index 6575b30..ed042f8 100644
--- a/src/bmserver/main.cpp
+++ b/src/bmserver/main.cpp
@@ -102,6 +102,16 @@ static bool initDatabase(const QString &dbfile, QString *error)
", UNIQUE(benchmarkId, metricId, platformId, hostId, branchId, snapshotId));");
Q_ASSERT(ok);
+ // context
+ ok = query.exec(
+ "CREATE TABLE context(id INTEGER PRIMARY KEY AUTOINCREMENT"
+ ", metricId INTEGER REFERENCES metric(id)"
+ ", platformId INTEGER REFERENCES platform(id)"
+ ", hostId INTEGER REFERENCES host(id)"
+ ", branchId INTEGER REFERENCES branch(id)"
+ ", UNIQUE(metricId, platformId, hostId, branchId));");
+ Q_ASSERT(ok);
+
// *** Create indexes ***
ok = query.exec("CREATE INDEX index_result_benchmarkId ON result(benchmarkId);");
@@ -141,6 +151,10 @@ static bool initDatabase(const QString &dbfile, QString *error)
ok = query.exec("CREATE INDEX index_snapshot_timestamp ON snapshot(timestamp);");
Q_ASSERT(ok);
+ ok = query.exec(
+ "CREATE INDEX index_context_all ON context(metricId, platformId, hostId, branchId);");
+ Q_ASSERT(ok);
+
return true;
}