Removed the ability to show "pictures" (maps) of rooms and maps of conferences.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 4 Jul 2011 21:42:02 +0000 (21:42 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 4 Jul 2011 21:42:02 +0000 (21:42 +0000)
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.

23 files changed:
src/create_tables.sql
src/gui/conferenceeditor.cpp
src/gui/conferenceeditor.h
src/gui/conferenceeditor.ui
src/gui/gui.pro
src/gui/mapwindow.cpp [deleted file]
src/gui/mapwindow.h [deleted file]
src/gui/mapwindow.ui [deleted file]
src/gui/tabcontainer.cpp
src/gui/tabcontainer.h
src/icons.qrc
src/icons/applications-internet.png [deleted file]
src/mvc/conference.cpp
src/mvc/conference.h
src/mvc/delegate.cpp
src/mvc/delegate.h
src/mvc/room.cpp
src/mvc/room.h
src/mvc/treeview.cpp
src/mvc/treeview.h
src/sql/schedulexmlparser.cpp
src/sql/sqlengine.cpp
src/sql/sqlengine.h

index f804900..a04b8d2 100644 (file)
@@ -10,8 +10,7 @@ CREATE TABLE CONFERENCE ( id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL
     , day_change INTEGER
     , timeslot_duration INTEGER
     , active INTEGER DEFAULT 0
     , 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
 
 CREATE TABLE TRACK ( id INTEGER  PRIMARY KEY AUTOINCREMENT  NOT NULL
     , xid_conference INTEGER NOT NULL
index d99628a..ac7b08e 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "conferencemodel.h"
 #include "urlinputdialog.h"
 
 #include "conferencemodel.h"
 #include "urlinputdialog.h"
-#include "mapwindow.h"
 #include "errormessage.h"
 
 #include <QInputDialog>
 #include "errormessage.h"
 
 #include <QInputDialog>
@@ -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(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
     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"));
                 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();
     }
         conferenceInfo->setCurrentIndex(0);
         removeBtn->show();
     }
@@ -219,18 +209,3 @@ void ConferenceEditor::importFinished(const QString& title)
     itemSelected(QModelIndex(), QModelIndex());
 }
 
     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();
-}
index adddd15..daa8f3f 100644 (file)
@@ -64,7 +64,6 @@ private slots:
     void removeClicked();
     void changeUrlClicked();
     void refreshClicked();
     void removeClicked();
     void changeUrlClicked();
     void refreshClicked();
-    void conferenceMapClicked();
 
 private:
     ConferenceModel* model;
 
 private:
     ConferenceModel* model;
index d4c8fda..94fd188 100644 (file)
              </widget>
             </item>
             <item row="1" column="3">
              </widget>
             </item>
             <item row="1" column="3">
-             <widget class="QPushButton" name="showMapButton">
-              <property name="text">
-               <string>MAP</string>
-              </property>
-              <property name="icon">
-               <iconset resource="../icons.qrc">
-                <normaloff>:/icons/applications-internet.png</normaloff>:/icons/applications-internet.png</iconset>
-              </property>
-              <property name="flat">
-               <bool>true</bool>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="4">
              <spacer name="horizontalSpacer_4">
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
              <spacer name="horizontalSpacer_4">
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
index f41eb37..e9b1dd4 100644 (file)
@@ -43,7 +43,6 @@ FORMS += searchhead.ui \
     eventdialog.ui \
     conflictsdialog.ui \
     tabcontainer.ui \
     eventdialog.ui \
     conflictsdialog.ui \
     tabcontainer.ui \
-    mapwindow.ui \
     settingsdialog.ui \
     conferenceeditor.ui \
     urlinputdialog.ui
     settingsdialog.ui \
     conferenceeditor.ui \
     urlinputdialog.ui
@@ -61,7 +60,6 @@ HEADERS += roomstabcontainer.h \
     daynavigatorwidget.h \
     eventdialog.h \
     tabcontainer.h \
     daynavigatorwidget.h \
     eventdialog.h \
     tabcontainer.h \
-    mapwindow.h \
     settingsdialog.h \
     conferenceeditor.h \
     urlinputdialog.h
     settingsdialog.h \
     conferenceeditor.h \
     urlinputdialog.h
@@ -79,7 +77,6 @@ SOURCES += roomstabcontainer.cpp \
     daynavigatorwidget.cpp \
     eventdialog.cpp \
     tabcontainer.cpp \
     daynavigatorwidget.cpp \
     eventdialog.cpp \
     tabcontainer.cpp \
-    mapwindow.cpp \
     settingsdialog.cpp \
     conferenceeditor.cpp \
     urlinputdialog.cpp
     settingsdialog.cpp \
     conferenceeditor.cpp \
     urlinputdialog.cpp
diff --git a/src/gui/mapwindow.cpp b/src/gui/mapwindow.cpp
deleted file mode 100644 (file)
index 1072159..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-#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 (file)
index f99bc45..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-#ifndef MAPWINDOW_H
-#define MAPWINDOW_H
-
-#include <QDialog>
-#include <QPixmap>
-#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 (file)
index 997b956..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MapWindow</class>
- <widget class="QDialog" name="MapWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>298</width>
-    <height>179</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="map">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text">
-      <string>Map goes here</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignCenter</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
index da4b7fb..357ea35 100644 (file)
@@ -27,7 +27,6 @@
 #include <delegate.h>
 
 #include "eventdialog.h"
 #include <delegate.h>
 
 #include "eventdialog.h"
-#include "mapwindow.h"
 #include "room.h"
 #include "errormessage.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(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
     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)));
 }
 
     disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));
 }
 
-void TabContainer::displayMap(const QModelIndex &aIndex)
-{
-    Event *event = static_cast<Event*>(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<Event*>(aIndex.internalPointer())->id(),this);
 void TabContainer::displayConflicts(const QModelIndex &aIndex)
 {
     ConflictsDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this);
index 6146268..572b995 100644 (file)
@@ -50,7 +50,6 @@ public slots:
 protected slots:
     virtual void updateTreeView(const QDate &aDate);
     void itemClicked(const QModelIndex &aIndex);
 protected slots:
     virtual void updateTreeView(const QDate &aDate);
     void itemClicked(const QModelIndex &aIndex);
-    void displayMap(const QModelIndex &aIndex);
     void displayConflicts(const QModelIndex &aIndex);
 };
 
     void displayConflicts(const QModelIndex &aIndex);
 };
 
index 644c48e..8f472ed 100644 (file)
@@ -1,14 +1,13 @@
 <RCC>
 <RCC>
-    <qresource prefix="/">
-        <file>icons/add.png</file>
-        <file>icons/remove.png</file>
-        <file>icons/reload.png</file>
-        <file>icons/appointment-soon-off.png</file>
-        <file>icons/appointment-soon.png</file>
-        <file>icons/applications-internet.png</file>
-        <file>icons/emblem-new-off.png</file>
-        <file>icons/emblem-new.png</file>
-        <file>icons/dialog-warning.png</file>
-        <file>icons/search.png</file>
-    </qresource>
+  <qresource prefix="/">
+    <file>icons/add.png</file>
+    <file>icons/remove.png</file>
+    <file>icons/reload.png</file>
+    <file>icons/appointment-soon-off.png</file>
+    <file>icons/appointment-soon.png</file>
+    <file>icons/emblem-new-off.png</file>
+    <file>icons/emblem-new.png</file>
+    <file>icons/dialog-warning.png</file>
+    <file>icons/search.png</file>
+  </qresource>
 </RCC>
 </RCC>
diff --git a/src/icons/applications-internet.png b/src/icons/applications-internet.png
deleted file mode 100644 (file)
index cc989b6..0000000
Binary files a/src/icons/applications-internet.png and /dev/null differ
index 667b0c5..1fd60d6 100644 (file)
@@ -33,7 +33,6 @@ QSqlRecord const Conference::sColumns = Conference::toRecord(QList<QSqlField>()
     << QSqlField("timeslot_duration", QVariant::Int)
     << QSqlField("active", QVariant::Bool)
     << QSqlField("url", QVariant::String)
     << QSqlField("timeslot_duration", QVariant::Int)
     << QSqlField("active", QVariant::Bool)
     << QSqlField("url", QVariant::String)
-    << QSqlField("map", QVariant::String)
     );
 
 QString const Conference::sTableName = QString("conference");
     );
 
 QString const Conference::sTableName = QString("conference");
index 1d70439..c9ae184 100644 (file)
@@ -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")); }
     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); }
 
     #if 0
     void setId(int id) { setValue("id", id); }
index d14daa2..9d4c8df 100644 (file)
@@ -149,8 +149,6 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         else
             mControls[AlarmControlOff]->paint(painter, option.rect);
 #endif
         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);
 
         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]));
     // 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,
 #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
 }
 
 bool Delegate::isPointFromRect(const QPoint &aPoint, const QRect &aRect) const
index 5f4428e..f24bea3 100644 (file)
@@ -37,7 +37,6 @@ class Delegate : public QItemDelegate
             FavouriteControlOff,
             AlarmControlOn,
             AlarmControlOff,
             FavouriteControlOff,
             AlarmControlOn,
             AlarmControlOff,
-            MapControl,
             WarningControl
         };
 
             WarningControl
         };
 
index 41cd35e..b0a455e 100644 (file)
 #include "room.h"
 
 QString const Room::sTableName = QString("room");
 #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>()
     << QSqlField("id", QVariant::Int)
 const QString Room::NAME = "name";
 
 QSqlRecord const Room::sColumns = Room::toRecord(QList<QSqlField>()
     << QSqlField("id", QVariant::Int)
-    << QSqlField(NAME, QVariant::String)
-    << QSqlField("picture", QVariant::String));
+    << QSqlField(NAME, QVariant::String));
 
 Room Room::retrieveByName(QString name)
 {
 
 Room Room::retrieveByName(QString name)
 {
index 2710c24..93c132f 100644 (file)
@@ -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); }
     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<Room> getAll();
     int insert();
 public:
     static QList<Room> getAll();
index 956e49f..151fd8a 100644 (file)
@@ -125,13 +125,6 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP
                 handled = true;
             }
             break;
                 handled = true;
             }
             break;
-        case Delegate::MapControl:
-            {
-                // handle Alarm Control clicked
-                emit(requestForMap(aIndex));
-                handled = true;
-            }
-        break;
         case Delegate::WarningControl:
         {
 
         case Delegate::WarningControl:
         {
 
index 0413850..888b6f7 100644 (file)
@@ -36,7 +36,6 @@ public slots:
 private slots:
     void handleItemClicked(const QModelIndex &index);
 signals:
 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
 };
     void requestForConflicts(const QModelIndex &aIndex);
     void eventHasChanged(int aEventId, bool aReloadModel = false); // emited when user changes some event details, eg. sets it Favourite
 };
index dadfa6a..bfea3a4 100644 (file)
@@ -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["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
                         SqlEngine::addRoomToDB(room);
 
                         // process event's nodes
index f85d1f6..5e60826 100644 (file)
@@ -67,8 +67,6 @@ QString SqlEngine::login(const QString &aDatabaseType, const QString &aDatabaseN
         database.open();
     }
 
         database.open();
     }
 
-    checkConferenceMap(database);
-
     //LOG_INFO(QString("Opening '%1' database '%2'").arg(aDatabaseType).arg(aDatabaseName));
 
     return result ? QString() : database.lastError().text();
     //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<QString,QString> &aRoom)
         else // ROOM record doesn't exist yet, need to create it
         {
             query = QSqlQuery(db);
         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_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);
             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;
 }
     }
     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");
-    }
-}
index 01d14b8..c10f3a2 100644 (file)
@@ -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<QString, QVariant>& params);
         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<QString, QVariant>& params);
-
-        static void checkConferenceMap(QSqlDatabase &aDatabase);
 };
 
 #endif /* SQLENGINE_H */
 };
 
 #endif /* SQLENGINE_H */