mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
remove date db column
This commit is contained in:
parent
75c672dc5f
commit
cff41cc6c0
2 changed files with 5 additions and 6 deletions
|
|
@ -93,11 +93,8 @@ Item {
|
||||||
}
|
}
|
||||||
section {
|
section {
|
||||||
property: "date"
|
property: "date"
|
||||||
labelPositioning: ViewSection.CurrentLabelAtStart
|
|
||||||
delegate: PlasmaComponents.ListItem {
|
delegate: PlasmaComponents.ListItem {
|
||||||
//width: view.width
|
id: sectionItem
|
||||||
//height: childrenRect.height
|
|
||||||
//color: syspal.base
|
|
||||||
sectionDelegate: true
|
sectionDelegate: true
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));
|
text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));
|
||||||
|
|
|
||||||
|
|
@ -109,12 +109,13 @@ ApplicationWindow {
|
||||||
|
|
||||||
db.transaction(
|
db.transaction(
|
||||||
function(tx) {
|
function(tx) {
|
||||||
var rs = tx.executeSql("INSERT INTO History VALUES(NULL, ?, date('now'), datetime('now'), ?, ? )", [number, duration, callType]);
|
var rs = tx.executeSql("INSERT INTO History VALUES(NULL, ?, datetime('now'), ?, ? )", [number, duration, callType]);
|
||||||
|
|
||||||
var rs = tx.executeSql('SELECT * FROM History where id=?', [rs.insertId]);
|
var rs = tx.executeSql('SELECT * FROM History where id=?', [rs.insertId]);
|
||||||
|
|
||||||
for(var i = 0; i < rs.rows.length; i++) {
|
for(var i = 0; i < rs.rows.length; i++) {
|
||||||
var row = rs.rows.item(i);
|
var row = rs.rows.item(i);
|
||||||
|
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
|
||||||
row.originalIndex = historyModel.count;
|
row.originalIndex = historyModel.count;
|
||||||
historyModel.append(row);
|
historyModel.append(row);
|
||||||
}
|
}
|
||||||
|
|
@ -168,12 +169,13 @@ ApplicationWindow {
|
||||||
function(tx) {
|
function(tx) {
|
||||||
// Create the database if it doesn't already exist
|
// Create the database if it doesn't already exist
|
||||||
//callType: wether is incoming, outgoing, unanswered
|
//callType: wether is incoming, outgoing, unanswered
|
||||||
tx.executeSql('CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, date DATE, time DATETIME, duration INTEGER, callType INTEGER)');
|
tx.executeSql('CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, time DATETIME, duration INTEGER, callType INTEGER)');
|
||||||
|
|
||||||
var rs = tx.executeSql('SELECT * FROM History');
|
var rs = tx.executeSql('SELECT * FROM History');
|
||||||
|
|
||||||
for(var i = 0; i < rs.rows.length; i++) {
|
for(var i = 0; i < rs.rows.length; i++) {
|
||||||
var row = rs.rows.item(i);
|
var row = rs.rows.item(i);
|
||||||
|
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
|
||||||
row.originalIndex = historyModel.count;
|
row.originalIndex = historyModel.count;
|
||||||
historyModel.append(row);
|
historyModel.append(row);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue