void HistoryManager::updateHistoryEntry(const KUrl &url, const QString &title) { QString urlString = url.url(); urlString.remove(QL1S("www.")); if(urlString.startsWith(QL1S("http")) && urlString.endsWith(QL1C('/'))) urlString.remove(urlString.length()-1,1); for (int i = 0; i < m_history.count(); ++i) { QString itemUrl = m_history.at(i).url; itemUrl.remove(QL1S("www.")); if(itemUrl.startsWith(QL1S("http")) && itemUrl.endsWith(QL1C('/'))) itemUrl.remove(itemUrl.length()-1,1); if (urlString == itemUrl) { m_history[i].title = title; m_history[i].url = url.url(); m_saveTimer->changeOccurred(); if (m_lastSavedUrl.isEmpty()) m_lastSavedUrl = m_history.at(i).url; emit entryUpdated(i); break; } } }
void DvbEpgTableModel::setEpgModel(DvbEpgModel *epgModel_) { if (epgModel != NULL) { Log("DvbEpgTableModel::setEpgModel: epg model already set"); return; } epgModel = epgModel_; connect(epgModel, SIGNAL(entryAdded(DvbSharedEpgEntry)), this, SLOT(entryAdded(DvbSharedEpgEntry))); connect(epgModel, SIGNAL(entryAboutToBeUpdated(DvbSharedEpgEntry)), this, SLOT(entryAboutToBeUpdated(DvbSharedEpgEntry))); connect(epgModel, SIGNAL(entryUpdated(DvbSharedEpgEntry)), this, SLOT(entryUpdated(DvbSharedEpgEntry))); connect(epgModel, SIGNAL(entryRemoved(DvbSharedEpgEntry)), this, SLOT(entryRemoved(DvbSharedEpgEntry))); }
void NotifyTableModel::entryAdded(NotificationItem* item) { insertRows(rowCount(), 1, QModelIndex()); NotificationItem* tmp = _list.at(rowCount() - 1); _list.replace(rowCount() - 1, item); delete tmp; entryUpdated(rowCount() - 1); }
/*! Displays the to-do viewer and populates the to-do entry attributes. \param entry Agenda entry from which attributes have to be read. */ void AgendaEventView::execute(AgendaEntry entry, AgendaEventViewer::Actions action) { OstTraceFunctionEntry0( AGENDAEVENTVIEW_EXECUTE_ENTRY ); mOriginalAgendaEntry = entry; mAgendaEntry = entry; // For later reference mParentId = mOwner->mAgendaUtil->parentEntry(mAgendaEntry).id(); // Add the viewer data reading from the agenda entry. addViewerData(); // Remove unnecessary widget from event viewer. removeWidget(); // Add the menu items to event viewer. addMenuItem(); // Add the toolbar items to event viewer addToolBarItem(action); // Connect for the entry updation and addtion signal to refresh the view // when the same is edited in editor. connect(mOwner->mAgendaUtil, SIGNAL(entryUpdated(ulong)), this, SLOT(handleEntryUpdation(ulong))); connect(mOwner->mAgendaUtil, SIGNAL(entryAdded(ulong)), this, SLOT(handleEntryUpdation(ulong))); // Connect for entry deletion signal to close the event viewer. connect(mOwner->mAgendaUtil, SIGNAL(entryDeleted(ulong)), this, SLOT(handleEntryDeletion(ulong))); // Add the view to the main window. HbMainWindow *window = hbInstance->allMainWindows().first(); if (!window) { // Might be some non-ui based app called us // so create mainwindow now mMainWindow = new HbMainWindow(); mMainWindow->addView(mViewer); mMainWindow->setCurrentView(mViewer); connect(mMainWindow,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation))); } else { window->addView(mViewer); window->setCurrentView(mViewer); connect(window,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation))); } // Add softkey after adding view on window mBackAction = new HbAction(Hb::BackNaviAction); mViewer->setNavigationAction(mBackAction); connect(mBackAction, SIGNAL(triggered()), this, SLOT(close())); OstTraceFunctionExit0( AGENDAEVENTVIEW_EXECUTE_EXIT ); }
AbstractItem::AbstractItem(QObject *parent) : QObject(parent) { crm = SugarCrm::getInstance(); connect(crm, SIGNAL(entryUpdated(QString)), this, SLOT(seeWhoSaved(QString))); connect(crm, SIGNAL(entryCreated(QString)), this, SLOT(gotCreated(QString))); }
void HistoryManager::updateHistoryItem(const QUrl &url, const QString &title) { for (int i = 0; i < m_history.count(); ++i) { if (url == m_history.at(i).url) { m_history[i].title = title; m_saveTimer->changeOccurred(); if (m_lastSavedUrl.isEmpty()) m_lastSavedUrl = m_history.at(i).url; emit entryUpdated(i); break; } } }
HistoryContentsWidget::HistoryContentsWidget(Window *window) : ContentsWidget(window), m_model(new QStandardItemModel(this)), m_isLoading(true), m_ui(new Ui::HistoryContentsWidget) { m_ui->setupUi(this); QStringList groups; groups << tr("Today") << tr("Yesterday") << tr("Earlier This Week") << tr("Previous Week") << tr("Earlier This Month") << tr("Earlier This Year") << tr("Older"); for (int i = 0; i < groups.count(); ++i) { m_model->appendRow(new QStandardItem(Utils::getIcon(QLatin1String("inode-directory")), groups.at(i))); } QStringList labels; labels << tr("Address") << tr("Title") << tr("Date"); m_model->setHorizontalHeaderLabels(labels); m_model->setSortRole(Qt::DisplayRole); m_ui->historyView->setModel(m_model); m_ui->historyView->setItemDelegate(new ItemDelegate(this)); m_ui->historyView->header()->setTextElideMode(Qt::ElideRight); m_ui->historyView->header()->setSectionResizeMode(0, QHeaderView::Stretch); m_ui->historyView->expand(m_model->index(0, 0)); QTimer::singleShot(100, this, SLOT(populateEntries())); connect(HistoryManager::getInstance(), SIGNAL(cleared()), this, SLOT(populateEntries())); connect(HistoryManager::getInstance(), SIGNAL(entryAdded(qint64)), this, SLOT(addEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(entryUpdated(qint64)), this, SLOT(updateEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(entryRemoved(qint64)), this, SLOT(removeEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(dayChanged()), this, SLOT(populateEntries())); connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterHistory(QString))); connect(m_ui->historyView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openEntry(QModelIndex))); connect(m_ui->historyView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); }