Changeset f299a08 for src


Ignore:
Timestamp:
04/22/10 17:34:03 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
66428e7
Parents:
c8c414f
Message:

remove obsoleted code

also fix some types

Location:
src
Files:
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    rc8c414f rf299a08  
    8282    QNetworkProxy::setApplicationProxy(proxy);
    8383
    84     #if 0
    85     // list of conferences must be maintained by ConferenceEditor
    86     // here must be one of the signals from the closing ConferenceEditor (or model):
    87     // selectedConf(conference), noConf()
    88     connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));
    89     connect(importScheduleWidget, SIGNAL(scheduleDeleted(const QString&)), SLOT(scheduleDeleted(const QString&)));
    90     #endif
    91 
    9284    // event details have changed
    9385    connect(dayTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool)));
     
    9890    connect(searchTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool)));
    9991
    100     // event conference map button clicked
    101     #if 0
    102     // TODO: think about it when return to maps
    103     connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
    104     #endif
    105 
    10692    connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp()));
    10793    connect(settingsAction, SIGNAL(triggered()), SLOT(setup()));
     
    116102    }
    117103
     104    // TODO: open conferences at startup?
    118105    #if 0
    119     // TODO: remove GUI
    120     // initialisation of model and pick active conference from there and call conferenceChanged()
    121     // selectConference->setDuplicatesEnabled(false);
    122     int confCount = Conference::getAll().count();
    123     if(confCount)
    124     {
    125         initTabs();
    126         // fillAndShowConferenceHeader();
    127         setWindowTitle(Conference::getById(confId).title());
    128 
    129         QList<Conference> confs = Conference::getAll();
    130         QListIterator<Conference> i(confs);
    131         while(i.hasNext())
    132         {
    133             Conference conf = i.next();
    134             // TODO: remove GUI
    135             // selectConference->addItem(conf.title(),conf.id());
    136         }
    137         // TODO: remove GUI
    138         // int idx = selectConference->findText(Conference::getById(Conference::activeConference()).title());
    139         // selectConference->setCurrentIndex(idx);
    140         // connect(selectConference, SIGNAL(currentIndexChanged(int)), SLOT(conferenceChanged(int)));
    141         // conferenceChanged(idx);
    142     }
    143     else
    144     {
    145         // TODO: remove GUI
    146         // conferenceHeader->hide();
    147         // selectConferenceWidget->hide();
    148         // // go to the 'conferenceTab', so the user can import the schedule
    149         // tabWidget->setCurrentIndex(6); // 6 - conference tab
     106    if(!confCount)
     107        tabWidget->setCurrentIndex(6); // 6 - conference tab
    150108    }
    151109    #endif
     
    170128}
    171129
    172 void MainWindow::scheduleImported(int aConfId)
    173 {
    174     Q_UNUSED(aConfId);
    175 
    176     // TODO: this all goes to ConferenceEditor and model of conferences
    177     #if 0
    178 
    179     Conference conf = Conference::getById(aConfId);
    180     if( selectConference->findText(conf.title()) < 0 ) // item doesn't exist
    181     {
    182         disconnect(selectConference, SIGNAL(currentIndexChanged(int)), this, SLOT(conferenceChanged(int)));
    183         selectConference->addItem(conf.title(),conf.id());
    184         connect(selectConference, SIGNAL(currentIndexChanged(int)), SLOT(conferenceChanged(int)));
    185     }
    186     int confCount = Conference::getAll().count();
    187     if(confCount)
    188     {
    189         int idx = selectConference->findText(conf.title());
    190         selectConference->setCurrentIndex(idx);
    191 
    192         selectConferenceWidget->show();
    193 
    194         conferenceChanged(idx);
    195     }
    196     #endif
    197 }
    198 
    199 void MainWindow::scheduleDeleted(const QString& title)
    200 {
    201     Q_UNUSED(title);
    202     // TODO: this all goes to ConferenceEditor and model of conferences
    203     #if 0
    204     int idx = selectConference->findText(title);
    205 
    206     if (idx == -1) {
    207         // should not happen
    208         qWarning() << __PRETTY_FUNCTION__ << "removed non-existent item:" << title;
    209         // this happens when you remove the only conference (the list is not ptoperly inited in this case)
    210         // now make sure that conferencet
    211         if (selectConference->count() > 0) {
    212             selectConference->setCurrentIndex(0);
    213             conferenceChanged(0);
    214         } else {
    215             conferenceChanged(-1);
    216         }
    217     } else {
    218         // will it signal "changed"?
    219         selectConference->removeItem(idx);
    220     }
    221     #endif
    222 }
    223 
    224130void MainWindow::aboutApp()
    225131{
     
    270176        // it takes much CPU, making travelling between conferences in ConferenceEditor longer
    271177        // and is not seen in maemo WM anyway
    272         // instead run it explicitly where needed
     178        // instead run it explicitly
     179        // 1. at startup
     180        // 2. when ConferenceEditor finished
    273181        // dont forget to protect the calls by try-catch!
    274182
     
    349257    ConferenceEditor dialog(conferenceModel, this);
    350258
    351     // TODO: connect signals about progress of network and parsing
    352 
    353259    connect(&dialog, SIGNAL(haveConferenceUrl(const QString&)), SLOT(importFromNetwork(const QString&)));
    354260    connect(&dialog, SIGNAL(haveConferenceFile(const QString&)), SLOT(importFromFile(const QString&)));
     
    366272    connect(this, SIGNAL(conferenceRemoved()), &dialog, SLOT(conferenceRemoved()));
    367273
     274    // TODO: propagate press of showMapButton here
     275    // connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
     276
    368277    dialog.exec();
    369278
     
    391300void MainWindow::importData(const QByteArray &aData, const QString& url)
    392301{
    393     // TODO: remove GUI
    394     // instead send signals to the child dialog
    395     #if 0
    396     browse->hide();
    397     online->hide();
    398     progressBar->show();
    399     // proxySettings->hide();
    400     #endif
    401 
    402     int confId = mXmlParser->parseData(aData, url);
    403 
    404     #if 0
    405     progressBar->hide();
    406     browse->show();
    407     online->show();
    408     // proxySettings->show();
    409     importScheduleLabel->setText("Schedule:");
    410 
    411     #endif
    412     if (confId > 0) {
    413         emit(scheduleImported(confId));
    414     }
     302    mXmlParser->parseData(aData, url);
    415303}
    416304
  • src/gui/mainwindow.h

    rc8c414f rf299a08  
    4141    void conferenceRemoved();
    4242private slots:
    43     void scheduleImported(int aConfId);
    44     void scheduleDeleted(const QString& title);
    4543    void aboutApp();
    4644    void conferenceMapClicked();
  • src/sql/schedulexmlparser.cpp

    rc8c414f rf299a08  
    3232}
    3333
    34 int ScheduleXmlParser::parseData(const QByteArray &aData, const QString& url)
     34void ScheduleXmlParser::parseData(const QByteArray &aData, const QString& url)
    3535{
    3636    QDomDocument document;
     
    3838    if (!document.setContent (aData, false, &xml_error)) {
    3939        error_message("Could not parse schedule: " + xml_error);
    40         return -1;
     40        return;
    4141    }
    4242
     
    156156    } // schedule element
    157157    SqlEngine::commitTransaction();
    158     emit parsingScheduleEnd(conference_title);
    159 
    160     return confId;
     158    if (!conference_title.isNull()) {
     159        emit parsingScheduleEnd(conference_title);
     160    } else {
     161        error_message("Could not parse schedule");
     162    }
    161163}
    162164
  • src/sql/schedulexmlparser.h

    rc8c414f rf299a08  
    2929
    3030    public slots:
    31         int parseData(const QByteArray &aData, const QString& url); // returns 'confId' of parsed conference schedule
     31        void parseData(const QByteArray &aData, const QString& url);
    3232
    3333    signals:
Note: See TracChangeset for help on using the changeset viewer.