Commit 4d82a879 authored by Tony Murray's avatar Tony Murray

Fix some issues with the new fields in the model:

  Zeroconf not initializing new values.
  Created date not sorting properly do to being of format FancyShortDate, may need more tweaking still.
Also switch from QInputDialog to KInputDialog.

svn path=/trunk/KDE/kdenetwork/krdc/; revision=1122436
parent 7a7517fc
......@@ -45,6 +45,7 @@
#include <KComboBox>
#include <KEditToolBar>
#include <KIcon>
#include <KInputDialog>
#include <KLineEdit>
#include <KLocale>
#include <KMenu>
......@@ -684,8 +685,9 @@ void MainWindow::showConnectionContextMenu(const QPoint &pos)
openFromRemoteDesktopsModel(index);
} else if (selectedAction == renameAction) {
//TODO: use inline editor if possible
const QString newTitle = QInputDialog::getText(this, i18n("Rename %1", title), i18n("Rename %1 to", title));
if (!newTitle.isEmpty()) {
bool ok = false;
const QString newTitle = KInputDialog::getText(i18n("Rename %1", title), i18n("Rename %1 to", title), "", &ok, this);
if (ok && !newTitle.isEmpty()) {
BookmarkManager::updateTitle(m_bookmarkManager->getManager(), url, newTitle);
}
} else if (selectedAction == settingsAction) {
......
......@@ -112,7 +112,7 @@ QVariant RemoteDesktopsModel::data(const QModelIndex &index, int role) const
return item.visits;
case RemoteDesktopsModel::Created:
if (item.created.isNull()) return QVariant();
return KGlobal::locale()->formatDateTime(item.created.toLocalZone(), KLocale::FancyShortDate);
return KGlobal::locale()->formatDateTime(item.created.toLocalZone(), KLocale::ShortDate);
case RemoteDesktopsModel::Source:
switch (item.source) {
case RemoteDesktop::Bookmarks:
......@@ -290,7 +290,9 @@ void RemoteDesktopsModel::servicesChanged()
if (!remoteDesktops.contains(item)) {
item.title = service->serviceName();
item.source = RemoteDesktop::Zeroconf;
item.created = KDateTime::currentLocalDateTime();
item.favorite = false;
item.visits = 0;
remoteDesktops.append(item);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment