Changeset e2c612c in confclerk_git


Ignore:
Timestamp:
09/25/12 22:50:11 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
f1826af
Parents:
5e50875
Message:

Reloading a conference works now.

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/gui/conferenceeditor.cpp

    r5e50875 re2c612c  
    179179}
    180180
    181 void ConferenceEditor::importFinished(const QString& title)
    182 {
     181void ConferenceEditor::importFinished(int conferenceId) {
    183182    addBtn->show();
    184183    // removeItem should be shown later, but it takes some time,
     
    191190    QApplication::processEvents();
    192191
    193     int num = model->rowCount();
    194     for (int i = 0; i < num; i++) {
    195         QModelIndex item = model->index(i, 0);
    196         if (model->data(item) == title) {
    197             emit wantCurrent(item, QItemSelectionModel::SelectCurrent);
    198             return;
    199         }
    200     }
    201     itemSelected(QModelIndex(), QModelIndex());
     192    QModelIndex item = model->indexFromId(conferenceId);
     193    if (item.isValid())
     194        emit wantCurrent(item, QItemSelectionModel::SelectCurrent);
     195    else
     196        itemSelected(QModelIndex(), QModelIndex());
    202197}
    203198
  • src/gui/conferenceeditor.h

    r5e50875 re2c612c  
    5656public slots:
    5757    void importStarted();
    58     void importFinished(const QString& title);
     58    void importFinished(int conferenceId);
    5959    void conferenceRemoved();
    6060    void showParsingProgress(int);
  • src/gui/mainwindow.cpp

    r5e50875 re2c612c  
    133133
    134134    connect(mXmlParser, SIGNAL(parsingScheduleBegin()), conferenceModel, SLOT(newConferenceBegin()));
    135     connect(mXmlParser, SIGNAL(parsingScheduleEnd(const QString&)), conferenceModel, SLOT(newConferenceEnd(const QString&)));
     135    connect(mXmlParser, SIGNAL(parsingScheduleEnd(int)), conferenceModel, SLOT(newConferenceEnd(int)));
    136136}
    137137
     
    341341    connect(mXmlParser, SIGNAL(parsingScheduleBegin()), &dialog, SLOT(importStarted()));
    342342    connect(mXmlParser, SIGNAL(progressStatus(int)), &dialog, SLOT(showParsingProgress(int)));
    343     connect(mXmlParser, SIGNAL(parsingScheduleEnd(const QString&)), &dialog, SLOT(importFinished(const QString&)));
     343    connect(mXmlParser, SIGNAL(parsingScheduleEnd(int)), &dialog, SLOT(importFinished(int)));
    344344
    345345    connect(this, SIGNAL(conferenceRemoved()), &dialog, SLOT(conferenceRemoved()));
  • src/mvc/conferencemodel.cpp

    r5e50875 re2c612c  
    7878}
    7979
    80 void ConferenceModel::newConferenceEnd(const QString& title)
    81 {
    82     Q_UNUSED(title);
     80void ConferenceModel::newConferenceEnd(int conferenceId) {
     81    Q_UNUSED(conferenceId);
    8382    reinit();
    8483}
  • src/mvc/conferencemodel.h

    r5e50875 re2c612c  
    4747public slots:
    4848    void newConferenceBegin();
    49     void newConferenceEnd(const QString& title);
     49    void newConferenceEnd(int conferenceId);
    5050    void conferenceRemoved();
    5151private:
  • src/sql/schedulexmlparser.cpp

    r5e50875 re2c612c  
    5555            emit(parsingScheduleBegin());
    5656            QHash<QString,QString> conference;
    57             conference["id"] = conferenceId; // conference ID is assigned automatically if 0
     57            conference["id"] = QVariant(conferenceId).toString(); // conference ID is assigned automatically if 0
    5858            conference["title"] = conferenceElement.firstChildElement("title").text();
    5959            conference["subtitle"] = conferenceElement.firstChildElement("subtitle").text();
     
    154154    sqlEngine->commitTransaction();
    155155    if (!conference_title.isNull()) {
    156         emit parsingScheduleEnd(conference_title);
     156        emit parsingScheduleEnd(conferenceId);
    157157    } else {
    158158        error_message("Could not parse schedule");
  • src/sql/schedulexmlparser.h

    r5e50875 re2c612c  
    3838        void progressStatus(int aStatus);
    3939        void parsingScheduleBegin();
    40         void parsingScheduleEnd(const QString& title);
     40        void parsingScheduleEnd(int conferenceId);
    4141};
    4242
  • src/sql/sqlengine.cpp

    r5e50875 re2c612c  
    163163        query.exec();
    164164        emitSqlQueryError(query);
    165         aConference["id"] = conferenceId;
     165        aConference["id"] = QVariant(conferenceId).toString();
    166166    }
    167167}
Note: See TracChangeset for help on using the changeset viewer.