mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +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 {
|
||||
property: "date"
|
||||
labelPositioning: ViewSection.CurrentLabelAtStart
|
||||
delegate: PlasmaComponents.ListItem {
|
||||
//width: view.width
|
||||
//height: childrenRect.height
|
||||
//color: syspal.base
|
||||
id: sectionItem
|
||||
sectionDelegate: true
|
||||
PlasmaComponents.Label {
|
||||
text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));
|
||||
|
|
|
|||
|
|
@ -109,12 +109,13 @@ ApplicationWindow {
|
|||
|
||||
db.transaction(
|
||||
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]);
|
||||
|
||||
for(var i = 0; i < rs.rows.length; i++) {
|
||||
var row = rs.rows.item(i);
|
||||
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
|
||||
row.originalIndex = historyModel.count;
|
||||
historyModel.append(row);
|
||||
}
|
||||
|
|
@ -168,12 +169,13 @@ ApplicationWindow {
|
|||
function(tx) {
|
||||
// Create the database if it doesn't already exist
|
||||
//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');
|
||||
|
||||
for(var i = 0; i < rs.rows.length; i++) {
|
||||
var row = rs.rows.item(i);
|
||||
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
|
||||
row.originalIndex = historyModel.count;
|
||||
historyModel.append(row);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue