Changeset 3a8dc71 for src/gui


Ignore:
Timestamp:
01/26/10 20:30:45 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
336fa33
Parents:
05afe5f
Message:

SqlEngine? made STATIC

Location:
src/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/gui/importschedulewidget.cpp

    r05afe5f r3a8dc71  
    22
    33#include <schedulexmlparser.h>
    4 #include <sqlengine.h>
    54
    65#include <QDir>
     
    1110ImportScheduleWidget::ImportScheduleWidget(QWidget *aParent)
    1211    : QWidget(aParent)
    13     , mSqlEngine(NULL)
    1412{
    1513    setupUi(this);
     
    3230}
    3331
    34 void ImportScheduleWidget::setSqlEngine(SqlEngine *aSqlEngine)
    35 {
    36     Q_ASSERT(aSqlEngine != NULL);
    37 
    38     mSqlEngine = aSqlEngine;
    39 }
    40 
    4132void ImportScheduleWidget::parsingSchedule(const QString &aTitle)
    4233{
     
    5142void ImportScheduleWidget::browseSchedule()
    5243{
    53     Q_ASSERT(mSqlEngine != NULL);
    54 
    5544    QString scheduleFileName = QFileDialog::getOpenFileName(this, tr("Select Conference Schedule"), QDir::homePath(), tr("Schedule Files (*.xml)"));
    5645    if(QFile::exists(scheduleFileName))
     
    6655        browse->hide();
    6756        progressBar->show();
    68         int confId = mXmlParser->parseData(data,mSqlEngine);
     57        int confId = mXmlParser->parseData(data);
    6958
    7059        progressBar->hide();
  • src/gui/importschedulewidget.h

    r05afe5f r3a8dc71  
    66
    77class ScheduleXmlParser;
    8 class SqlEngine;
    98
    109class ImportScheduleWidget : public QWidget, Ui::ImportScheduleWidget
     
    1211    Q_OBJECT
    1312    public:
    14         ImportScheduleWidget(QWidget *aParent = NULL); // don't forget to use setSqlEngine()
     13        ImportScheduleWidget(QWidget *aParent = NULL);
    1514        ~ImportScheduleWidget();
    16         void setSqlEngine(SqlEngine *aSqlEngine);
    1715    private slots:
    1816        void browseSchedule();
     
    2321    private:
    2422        ScheduleXmlParser *mXmlParser;
    25         SqlEngine *mSqlEngine; // uses it
    2623};
    2724
  • src/gui/mainwindow.cpp

    r05afe5f r3a8dc71  
    2727{
    2828    setupUi(this);
    29 
    30     // create "SQLITE" DB instance/connection
    31     // opens DB connection (needed for EventModel)
    32     mSqlEngine = new SqlEngine(this);
    33     //mSqlEngine->initialize();
    34     importScheduleWidget->setSqlEngine(mSqlEngine);
    3529
    3630    // Sanity check for existence of any Conference in the DB
     
    127121}
    128122
    129 MainWindow::~MainWindow()
    130 {
    131     if(mSqlEngine)
    132     {
    133         delete mSqlEngine;
    134         mSqlEngine = NULL;
    135     }
    136 }
    137 
    138123void MainWindow::scheduleImported(int aConfId)
    139124{
     
    204189    QString keyword = searchEdit->text().replace( QString("%"), QString("\\%") );
    205190    qDebug() << "\nKeyword to search: " << keyword;
    206     mSqlEngine->searchEvent( AppSettings::confId(), columns, keyword );
     191    SqlEngine::searchEvent( AppSettings::confId(), columns, keyword );
    207192
    208193    QDate aStartDate = Conference::getById(AppSettings::confId()).start();
  • src/gui/mainwindow.h

    r05afe5f r3a8dc71  
    55
    66#include <ui_mainwindow.h>
    7 
    8 class SqlEngine;
    97
    108class MainWindow : public QMainWindow, private Ui::MainWindow
     
    1513    // Event dialog for given Event ID
    1614    MainWindow(int aEventId = 0, QWidget *aParent = NULL);
    17     ~MainWindow();
     15    ~MainWindow() {}
    1816private slots:
    1917    void scheduleImported(int aConfId);
     
    2422    void conferenceMapClicked();
    2523    void eventHasChanged(int aEventId);
    26 private:
    27     SqlEngine *mSqlEngine;
    2824};
    2925
Note: See TracChangeset for help on using the changeset viewer.