From e6ab8a2351ae5a228624dd5de074862ad6a3132d Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Mon, 4 Jul 2011 21:42:02 +0000 Subject: [PATCH] Removed the ability to show "pictures" (maps) of rooms and maps of conferences. The XML file does not contain picture/map/image information of conferences or rooms. We left the room.picture definition in the database SQL because there is no "drop column" in sqlite. --- src/create_tables.sql | 3 +- src/gui/conferenceeditor.cpp | 25 -------------- src/gui/conferenceeditor.h | 1 - src/gui/conferenceeditor.ui | 14 -------- src/gui/gui.pro | 3 -- src/gui/mapwindow.cpp | 49 ---------------------------- src/gui/mapwindow.h | 37 --------------------- src/gui/mapwindow.ui | 43 ------------------------ src/gui/tabcontainer.cpp | 24 -------------- src/gui/tabcontainer.h | 1 - src/icons.qrc | 23 +++++++------ src/icons/applications-internet.png | Bin 2654 -> 0 bytes src/mvc/conference.cpp | 1 - src/mvc/conference.h | 1 - src/mvc/delegate.cpp | 12 +------ src/mvc/delegate.h | 1 - src/mvc/room.cpp | 5 ++- src/mvc/room.h | 8 ----- src/mvc/treeview.cpp | 7 ---- src/mvc/treeview.h | 1 - src/sql/schedulexmlparser.cpp | 1 - src/sql/sqlengine.cpp | 15 +-------- src/sql/sqlengine.h | 2 -- 23 files changed, 16 insertions(+), 261 deletions(-) delete mode 100644 src/gui/mapwindow.cpp delete mode 100644 src/gui/mapwindow.h delete mode 100644 src/gui/mapwindow.ui delete mode 100644 src/icons/applications-internet.png diff --git a/src/create_tables.sql b/src/create_tables.sql index f804900..a04b8d2 100644 --- a/src/create_tables.sql +++ b/src/create_tables.sql @@ -10,8 +10,7 @@ CREATE TABLE CONFERENCE ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , day_change INTEGER , timeslot_duration INTEGER , active INTEGER DEFAULT 0 - , url VARCHAR - , map VARCHAR); + , url VARCHAR); CREATE TABLE TRACK ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , xid_conference INTEGER NOT NULL diff --git a/src/gui/conferenceeditor.cpp b/src/gui/conferenceeditor.cpp index d99628a..ac7b08e 100644 --- a/src/gui/conferenceeditor.cpp +++ b/src/gui/conferenceeditor.cpp @@ -21,7 +21,6 @@ #include "conferencemodel.h" #include "urlinputdialog.h" -#include "mapwindow.h" #include "errormessage.h" #include @@ -50,7 +49,6 @@ ConferenceEditor::ConferenceEditor(ConferenceModel* model, QWidget* parent) connect(removeBtn, SIGNAL(clicked()), SLOT(removeClicked())); connect(changeUrl, SIGNAL(clicked()), SLOT(changeUrlClicked())); connect(refreshBtn, SIGNAL(clicked()), SLOT(refreshClicked())); - connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked())); connect(buttonBox, SIGNAL(rejected()), SLOT(close())); // it's OK to emit selection signals here @@ -96,14 +94,6 @@ void ConferenceEditor::itemSelected(const QModelIndex& current, const QModelInde conf.start().toString("dd-MM-yyyy") + ", " + conf.end().toString("dd-MM-yyyy")); - - QString map = conf.map(); - if (map.isEmpty()) { - showMapButton->hide(); - } else { - showMapButton->show(); - } - conferenceInfo->setCurrentIndex(0); removeBtn->show(); } @@ -219,18 +209,3 @@ void ConferenceEditor::importFinished(const QString& title) itemSelected(QModelIndex(), QModelIndex()); } -void ConferenceEditor::conferenceMapClicked() -{ - Conference conf = Conference::getById(selected_id); - QString mapPath = conf.map(); - if(mapPath.isEmpty() or !QFile::exists(mapPath)) { - error_message("Map is not available"); - return; - } - - QString roomName; - - QPixmap map(mapPath); - MapWindow window(map,roomName,this); - window.exec(); -} diff --git a/src/gui/conferenceeditor.h b/src/gui/conferenceeditor.h index adddd15..daa8f3f 100644 --- a/src/gui/conferenceeditor.h +++ b/src/gui/conferenceeditor.h @@ -64,7 +64,6 @@ private slots: void removeClicked(); void changeUrlClicked(); void refreshClicked(); - void conferenceMapClicked(); private: ConferenceModel* model; diff --git a/src/gui/conferenceeditor.ui b/src/gui/conferenceeditor.ui index d4c8fda..94fd188 100644 --- a/src/gui/conferenceeditor.ui +++ b/src/gui/conferenceeditor.ui @@ -216,20 +216,6 @@ - - - MAP - - - - :/icons/applications-internet.png:/icons/applications-internet.png - - - true - - - - Qt::Horizontal diff --git a/src/gui/gui.pro b/src/gui/gui.pro index f41eb37..e9b1dd4 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -43,7 +43,6 @@ FORMS += searchhead.ui \ eventdialog.ui \ conflictsdialog.ui \ tabcontainer.ui \ - mapwindow.ui \ settingsdialog.ui \ conferenceeditor.ui \ urlinputdialog.ui @@ -61,7 +60,6 @@ HEADERS += roomstabcontainer.h \ daynavigatorwidget.h \ eventdialog.h \ tabcontainer.h \ - mapwindow.h \ settingsdialog.h \ conferenceeditor.h \ urlinputdialog.h @@ -79,7 +77,6 @@ SOURCES += roomstabcontainer.cpp \ daynavigatorwidget.cpp \ eventdialog.cpp \ tabcontainer.cpp \ - mapwindow.cpp \ settingsdialog.cpp \ conferenceeditor.cpp \ urlinputdialog.cpp diff --git a/src/gui/mapwindow.cpp b/src/gui/mapwindow.cpp deleted file mode 100644 index 1072159..0000000 --- a/src/gui/mapwindow.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ -#include "mapwindow.h" - -MapWindow::MapWindow(const QPixmap &aImage, const QString &aName, QWidget *aParent) - : QDialog(aParent) -{ - setupUi(this); -#ifdef MAEMO - showFullScreen(); - //map->setScaledContents(true); - //map->setPixmap(aImage.scaled(QSize(800,480),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation)); - map->setPixmap(aImage.scaled(QSize(640,480),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation)); -#elif N810 - showMaximized(); - map->setPixmap(aImage.scaled(QSize(400,300),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation)); -#else - map->setPixmap(aImage); -#endif - setMouseTracking(true); // to receive mouse events - setWindowTitle(aName); -} - -// it is enough to handle mouseReleaseEvent, instead of -// getting/creating mouseClikEvent, since the whole window -// is occupied by only-one widget/label (image/map) -void MapWindow::mouseReleaseEvent(QMouseEvent *event) -{ - Q_UNUSED(event); - close(); -} - diff --git a/src/gui/mapwindow.h b/src/gui/mapwindow.h deleted file mode 100644 index f99bc45..0000000 --- a/src/gui/mapwindow.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ -#ifndef MAPWINDOW_H -#define MAPWINDOW_H - -#include -#include -#include "ui_mapwindow.h" - -class MapWindow : public QDialog, Ui::MapWindow -{ -public: - MapWindow(const QPixmap &aImage, const QString &aName, QWidget *aParent = NULL); - ~MapWindow() {} -protected: - virtual void mouseReleaseEvent(QMouseEvent *event); -}; - -#endif /* MAPWINDOW_H */ - diff --git a/src/gui/mapwindow.ui b/src/gui/mapwindow.ui deleted file mode 100644 index 997b956..0000000 --- a/src/gui/mapwindow.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - MapWindow - - - - 0 - 0 - 298 - 179 - - - - - 0 - 0 - - - - Dialog - - - - - - - 0 - 0 - - - - Map goes here - - - Qt::AlignCenter - - - - - - - - diff --git a/src/gui/tabcontainer.cpp b/src/gui/tabcontainer.cpp index da4b7fb..357ea35 100644 --- a/src/gui/tabcontainer.cpp +++ b/src/gui/tabcontainer.cpp @@ -27,7 +27,6 @@ #include #include "eventdialog.h" -#include "mapwindow.h" #include "room.h" #include "errormessage.h" @@ -49,7 +48,6 @@ TabContainer::TabContainer(QWidget *aParent) connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool))); connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); - connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &))); // day navigator is hidden by default @@ -82,28 +80,6 @@ void TabContainer::itemClicked(const QModelIndex &aIndex) disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); } -void TabContainer::displayMap(const QModelIndex &aIndex) -{ - Event *event = static_cast(aIndex.internalPointer()); - - QVariant mapPathV = event->room()->map(); - QString mapPath; - if (!mapPathV.isValid()) { - error_message("No map for this room"); - return; - } else { - mapPath = mapPathV.toString(); - if (!QFile::exists(mapPath)) { - error_message("Map for this room not found: " + mapPath); - return; - } - } - - QPixmap map(mapPath); - MapWindow window(map, event->room()->name(),this); - window.exec(); -} - void TabContainer::displayConflicts(const QModelIndex &aIndex) { ConflictsDialog dialog(static_cast(aIndex.internalPointer())->id(),this); diff --git a/src/gui/tabcontainer.h b/src/gui/tabcontainer.h index 6146268..572b995 100644 --- a/src/gui/tabcontainer.h +++ b/src/gui/tabcontainer.h @@ -50,7 +50,6 @@ public slots: protected slots: virtual void updateTreeView(const QDate &aDate); void itemClicked(const QModelIndex &aIndex); - void displayMap(const QModelIndex &aIndex); void displayConflicts(const QModelIndex &aIndex); }; diff --git a/src/icons.qrc b/src/icons.qrc index 644c48e..8f472ed 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -1,14 +1,13 @@ - - icons/add.png - icons/remove.png - icons/reload.png - icons/appointment-soon-off.png - icons/appointment-soon.png - icons/applications-internet.png - icons/emblem-new-off.png - icons/emblem-new.png - icons/dialog-warning.png - icons/search.png - + + icons/add.png + icons/remove.png + icons/reload.png + icons/appointment-soon-off.png + icons/appointment-soon.png + icons/emblem-new-off.png + icons/emblem-new.png + icons/dialog-warning.png + icons/search.png + diff --git a/src/icons/applications-internet.png b/src/icons/applications-internet.png deleted file mode 100644 index cc989b60ed03dee589d057c0889f7b4a4faf4fd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2654 zcmV-k3ZeChP)Mh5=KJ?A0000XbVXQnQ*U*0V`TtnbaZe!FE46oZEay=E^T#lX=7+% zY-}!LdTD0kUH||IbV)=(R9M5sS9xq4^%ef+-r2*uUayb!NgT&^Y!ZT#6bdnga+pRy zFVR311XM_sP)P-%wEwlJ|Fsn$B3jhaLxMJHp$KT@#36D@C`pKu;24rPaU5T<9eWRZ zubG{@Z^p*h4WXg^qboh_HS>Gld+&SSd&4-6ga7A?ztRi8^~9@DK{W1SS@wPhPBX!d zIkppI7&Z?$N&0@4ahzR-F8uv3&)l27(sP;rl!322`l}Y7C_T%uxMh87owc^HDi99I zkbMGp`Y~J3Fqc&@o6ccmB3T%pN^!bo?Pmq<@i(9Q&YAxjz}6i*C8L0yV4dyT@3}#` z^|~h3rfYRwhb(er3@8IQJUEL}V{>3x1|h$QkSyTvi4l9?1g#c3)YE52>t*blyOjpFwq*42D^_w)@B!CK3wfbE;>iZQ=U1 zTBPO+*t7owHIpfvF>JHz#Optvy&?cjT|cN0IkErI?YC9jcjq;nX|tHi6%p{UFdY%L zr6U^TF+4tt@kAaa;RuE<%+oara#W6ox>~_eHZ;@5_{A(S=rv+rEObc_w>dVYQh z2zL3GHCuN`mVurJzTR1W?;Y#7Owp#ORm38GIAGutc^HO9wVnYZhY^icAd}6)Pkiu8 z0=9jr5vFP4-TqO;OJ!_mis6TkbnzYS)#YkI?{Uxn%q}og;e`!XH?%zb)s4Jm=tOQ2 zm60IPK!Yr>-~vHZ`eovQfkM%sJ5(5E6l^|^cqEJi$A%CH2C%86nmEBimKZV~k3V<^ zKR7hmGBc;VKsP<|sU?Wtw4+VpgkyVN`o6C;$bshtxc_i;P(jr(m&sGqr6?~ihfJ{Z zN)f4yLRP@!aollJ8c>JyRIDYiZTSbd;HclUS{?sKU@Co8`J09v1 zBLNLbBY65Zd$99Qy-NTr z3Z|yA1nrGgw(D;N2}Mb~@3tFSv94S3~^chE>Ysips@+)XP>VA-)CQ9CiOpd{dj6bK^_i6gI?BrvMS_9Q8rYpHC( zQ@l*Rh_Uf8tXtc>j1TTR@UgZvUsZ+E!;{c74d1@|ddf_WuHZnD9$QfY%eDi_0*ioP zVs&E}2M3eH{+L%|O*bJ59Pxr(B&JREH=&XaWK#(u?A8C~+*#3v>s#vZ&fx(VG(+|t z9LB@jTHJpFD*#a4^V4Z1Jaj=rM4H0Y4PjiE%VEQ+8cd}MKlGKaXcOn7Z;XP7nl!YQm zvf^*RPycufdEG%enZmE*6(|h{JjX5o*N&Vxhsl(I>o$}lNu5P9GPoiGj$`i{IC;KM zPD95{tzj7O^Q8BMJQ1kqMRZkN6}I2rg4Hp`>x?ulA#S_6%ScAGiIf_2i^1XJCy~!* z$#Ud8PiGX+{q872q?W52s`25_c!2`kwE}?1Gu`J#rZ}FZHlm5=O6q)O;Sl#Q7l@lu zNfgla#a3J#9`I&>3u2B+;dY8jjx1fpne!Kr%Vn29;l<)Xc$>tghUGpZ!6$T1pMitjce8bqLY25a#ESwBrFK!4TF3LR43i>Z^Jk zBKu_82ZHcPG6ZT_L6G1GQ9z2o$H{oL`;gIlcwi@>rj_2t&9yaN`UzX8W zUxCS)EPngiK5cSp>dfrP?gx$e(OGYY0~GS9eI@|1D2e~7Sliv-mBaP7effqK?#?ai zS%DlCRE?xrrxEMWP@&C;0Et9SKkbU4piHG=@aDcgd+&kcM3IS}#HlxbNsK)24$?&c z>g52i%K-Sus@-LY50tNoHr>2Uj@GPiX^7h$>sIp(Rb@=LB!GZl^0YlmA~cxv)E7{+_{aluH7@2-i9 zz{EuYyIFI0C4JG{=uCIRU;M7o`R4!haC#YF9~+kTaBmg({LlLT0(rnyEz7iKtN;K2 M07*qoM6N<$f+HRQF8}}l diff --git a/src/mvc/conference.cpp b/src/mvc/conference.cpp index 667b0c5..1fd60d6 100644 --- a/src/mvc/conference.cpp +++ b/src/mvc/conference.cpp @@ -33,7 +33,6 @@ QSqlRecord const Conference::sColumns = Conference::toRecord(QList() << QSqlField("timeslot_duration", QVariant::Int) << QSqlField("active", QVariant::Bool) << QSqlField("url", QVariant::String) - << QSqlField("map", QVariant::String) ); QString const Conference::sTableName = QString("conference"); diff --git a/src/mvc/conference.h b/src/mvc/conference.h index 1d70439..c9ae184 100644 --- a/src/mvc/conference.h +++ b/src/mvc/conference.h @@ -51,7 +51,6 @@ public: int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds bool isActive() const { return value("active").toBool(); } QString url() const { return stringFromNullable(value("url")); } - QString map() const { return stringFromNullable(value("map")); } #if 0 void setId(int id) { setValue("id", id); } diff --git a/src/mvc/delegate.cpp b/src/mvc/delegate.cpp index d14daa2..9d4c8df 100644 --- a/src/mvc/delegate.cpp +++ b/src/mvc/delegate.cpp @@ -149,8 +149,6 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons else mControls[AlarmControlOff]->paint(painter, option.rect); #endif - if (event->room()->hasMap()) - mControls[MapControl]->paint(painter, option.rect); if(event->hasTimeConflict()) mControls[WarningControl]->paint(painter, option.rect); @@ -375,19 +373,11 @@ void Delegate::defineControls() // off mControls.insert(AlarmControlOff, new Control(AlarmControlOff, QString(":icons/appointment-soon-off.png"), mControls[FavouriteControlOff])); - - // MAP ICON - mControls.insert(MapControl, - new Control(MapControl, QString(":icons/applications-internet.png"), mControls[AlarmControlOn])); -#else - // MAP ICON - mControls.insert(MapControl, - new Control(MapControl, QString(":icons/applications-internet.png"), mControls[FavouriteControlOn])); #endif // WARNING ICON mControls.insert(WarningControl, - new Control(WarningControl, QString(":icons/dialog-warning.png"), mControls[MapControl])); + new Control(WarningControl, QString(":icons/dialog-warning.png"), mControls[FavouriteControlOn])); } bool Delegate::isPointFromRect(const QPoint &aPoint, const QRect &aRect) const diff --git a/src/mvc/delegate.h b/src/mvc/delegate.h index 5f4428e..f24bea3 100644 --- a/src/mvc/delegate.h +++ b/src/mvc/delegate.h @@ -37,7 +37,6 @@ class Delegate : public QItemDelegate FavouriteControlOff, AlarmControlOn, AlarmControlOff, - MapControl, WarningControl }; diff --git a/src/mvc/room.cpp b/src/mvc/room.cpp index 41cd35e..b0a455e 100644 --- a/src/mvc/room.cpp +++ b/src/mvc/room.cpp @@ -21,13 +21,12 @@ #include "room.h" QString const Room::sTableName = QString("room"); -int const Room::sTableColCount = 3; +int const Room::sTableColCount = 2; const QString Room::NAME = "name"; QSqlRecord const Room::sColumns = Room::toRecord(QList() << QSqlField("id", QVariant::Int) - << QSqlField(NAME, QVariant::String) - << QSqlField("picture", QVariant::String)); + << QSqlField(NAME, QVariant::String)); Room Room::retrieveByName(QString name) { diff --git a/src/mvc/room.h b/src/mvc/room.h index 2710c24..93c132f 100644 --- a/src/mvc/room.h +++ b/src/mvc/room.h @@ -35,14 +35,6 @@ public: void setId(int id) { setValue("id", id); } QString name() const { return value("name").toString(); } void setName(const QString & type) { setValue("name", type); } - // TODO: make naming consistent - either "picture" or "map" - QVariant map() const { return value("picture"); } - bool hasMap() const - { - // empty strings also treasted as NULL, - // as storing NULLs requires rewrite of storing code and DB scheme - return !isNull("picture") and !value("picture").toString().isEmpty(); - } int insert(); public: static QList getAll(); diff --git a/src/mvc/treeview.cpp b/src/mvc/treeview.cpp index 956e49f..151fd8a 100644 --- a/src/mvc/treeview.cpp +++ b/src/mvc/treeview.cpp @@ -125,13 +125,6 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP handled = true; } break; - case Delegate::MapControl: - { - // handle Alarm Control clicked - emit(requestForMap(aIndex)); - handled = true; - } - break; case Delegate::WarningControl: { diff --git a/src/mvc/treeview.h b/src/mvc/treeview.h index 0413850..888b6f7 100644 --- a/src/mvc/treeview.h +++ b/src/mvc/treeview.h @@ -36,7 +36,6 @@ public slots: private slots: void handleItemClicked(const QModelIndex &index); signals: - void requestForMap(const QModelIndex &aIndex); void requestForConflicts(const QModelIndex &aIndex); void eventHasChanged(int aEventId, bool aReloadModel = false); // emited when user changes some event details, eg. sets it Favourite }; diff --git a/src/sql/schedulexmlparser.cpp b/src/sql/schedulexmlparser.cpp index dadfa6a..bfea3a4 100644 --- a/src/sql/schedulexmlparser.cpp +++ b/src/sql/schedulexmlparser.cpp @@ -103,7 +103,6 @@ void ScheduleXmlParser::parseData(const QByteArray &aData, const QString& url) room["name"] = roomElement.attribute("name"); room["event_id"] = eventElement.attribute("id"); room["conference_id"] = QString::number(confId,10); - room["picture"] = ""; // TODO: implement some mapping to assign correct picture to specified room_name SqlEngine::addRoomToDB(room); // process event's nodes diff --git a/src/sql/sqlengine.cpp b/src/sql/sqlengine.cpp index f85d1f6..5e60826 100644 --- a/src/sql/sqlengine.cpp +++ b/src/sql/sqlengine.cpp @@ -67,8 +67,6 @@ QString SqlEngine::login(const QString &aDatabaseType, const QString &aDatabaseN database.open(); } - checkConferenceMap(database); - //LOG_INFO(QString("Opening '%1' database '%2'").arg(aDatabaseType).arg(aDatabaseName)); return result ? QString() : database.lastError().text(); @@ -256,10 +254,9 @@ void SqlEngine::addRoomToDB(QHash &aRoom) else // ROOM record doesn't exist yet, need to create it { query = QSqlQuery(db); - query.prepare("INSERT INTO ROOM (xid_conference,name,picture) VALUES (:xid_conference, :name, :picture)"); + query.prepare("INSERT INTO ROOM (xid_conference,name,picture) VALUES (:xid_conference, :name, '')"); query.bindValue(":xid_conference", aRoom["conference_id"]); query.bindValue(":xid_name", aRoom["name"]); - query.bindValue(":xid_picture", aRoom["picture"]); if (!query.exec()) qDebug() << "Could not execute 'insert into room ...' query." << query.lastError(); aRoom["id"]= query.lastInsertId().toString(); // 'id' is assigned automatically //LOG_AUTOTEST(query); @@ -401,13 +398,3 @@ bool SqlEngine::execQueryWithParameter(QSqlDatabase &aDatabase, const QString &a } return true; } - -void SqlEngine::checkConferenceMap(QSqlDatabase &aDatabase) -{ - QSqlQuery sqlQuery(aDatabase); - sqlQuery.prepare("SELECT map FROM conference"); - if (!sqlQuery.exec()) { - qWarning() << "column conference.map is missing; adding"; - execQuery(aDatabase, "ALTER TABLE conference ADD COLUMN map VARCHAR"); - } -} diff --git a/src/sql/sqlengine.h b/src/sql/sqlengine.h index 01d14b8..c10f3a2 100644 --- a/src/sql/sqlengine.h +++ b/src/sql/sqlengine.h @@ -48,8 +48,6 @@ class SqlEngine : public QObject static QString login(const QString &aDatabaseType, const QString &aDatabaseName); static bool execQuery(QSqlDatabase &aDatabase, const QString &aQuery); static bool execQueryWithParameter(QSqlDatabase &aDatabase, const QString &aQuery, const QHash& params); - - static void checkConferenceMap(QSqlDatabase &aDatabase); }; #endif /* SQLENGINE_H */ -- 2.39.5