Commit df260e7b authored by Jeremy Whiting's avatar Jeremy Whiting

Updated krdc with fixes from Laurent's review on reviewboard.

Use QStringLiteral instead of QLatin1String.
Remove KI18n prefix in #include statements.
Use QUrl::fromLocalFile for local urls.
parent d1b0c274
......@@ -26,7 +26,7 @@
#include "logging.h"
#include <KBookmarks/KBookmarkOwner>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <QStandardPaths>
......@@ -69,7 +69,7 @@ void BookmarkManager::addHistoryBookmark(RemoteView *view)
{
KBookmark bm = m_historyGroup.first();
const QString urlString = urlForView(view);
const QUrl url = QUrl(urlString);
const QUrl url = QUrl::fromLocalFile(urlString);
while (!bm.isNull()) {
if (bm.url() == url) {
qCDebug(KRDC) << "Found URL. Move it at the history start.";
......
......@@ -42,12 +42,12 @@ public:
BookmarkManager(KActionCollection *collection, QMenu *menu, MainWindow *parent);
~BookmarkManager();
virtual QUrl currentUrl() const Q_DECL_OVERRIDE;
virtual QString currentTitle() const Q_DECL_OVERRIDE;
QUrl currentUrl() const Q_DECL_OVERRIDE;
QString currentTitle() const Q_DECL_OVERRIDE;
virtual bool addBookmarkEntry() const;
virtual bool editBookmarkEntry() const;
virtual bool supportsTabs() const Q_DECL_OVERRIDE;
virtual QList<KBookmarkOwner::FutureBookmark> currentBookmarkList() const Q_DECL_OVERRIDE;
bool supportsTabs() const Q_DECL_OVERRIDE;
QList<KBookmarkOwner::FutureBookmark> currentBookmarkList() const Q_DECL_OVERRIDE;
void addHistoryBookmark(RemoteView *view);
void addManualBookmark(const QUrl &url, const QString &text);
KBookmarkManager* getManager();
......
......@@ -26,7 +26,7 @@
#include "logging.h"
#include <QIcon>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <KWidgetsAddons/KMessageBox>
#include <QFile>
......
......@@ -27,7 +27,7 @@
#include "ui_general.h"
#include <KConfigGui/KConfigSkeleton>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <KCMUtils/KPluginSelector>
#include <KPluginTrader>
#include <KService/KPluginInfo>
......
......@@ -25,7 +25,7 @@
#include "remotedesktopsmodel.h"
#include <KIconThemes/KIconLoader>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <QDateTime>
#include <QIcon>
......@@ -71,7 +71,7 @@ void ConnectionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
QVariant value = index.data(Qt::CheckStateRole);
if (value.isValid()) {
Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt());
QIcon favIcon = QIcon(QLatin1String("bookmarks"));
QIcon favIcon = QIcon::fromTheme(QLatin1String("bookmarks"));
QIcon::Mode mode = (checkState == Qt::Checked) ? QIcon::Active : QIcon::Disabled;
favIcon.paint(painter, option.rect, option.decorationAlignment, mode);
......
......@@ -25,7 +25,7 @@
#include "logging.h"
#include "settings.h"
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <KWidgetsAddons/KPageDialog>
#include <QCheckBox>
......
......@@ -28,7 +28,7 @@
#include <KCoreAddons/KAboutData>
#include <Kdelibs4ConfigMigrator>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <QTime>
#include <QCommandLineOption>
#include <QCommandLineParser>
......@@ -36,7 +36,7 @@
int main(int argc, char **argv)
{
const QLatin1String appName("krdc");
const QString appName = QStringLiteral("krdc");
QApplication app(argc, argv);
QTime startupTimer;
startupTimer.start();
......@@ -44,7 +44,7 @@ int main(int argc, char **argv)
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
Kdelibs4ConfigMigrator migrate(appName);
migrate.setConfigFiles(QStringList() << QLatin1String("krdcrc"));
migrate.setConfigFiles(QStringList() << QStringLiteral("krdcrc"));
migrate.migrate();
KAboutData aboutData(appName, i18n("KRDC"), QString(KRDC_VERSION),
......@@ -59,15 +59,15 @@ int main(int argc, char **argv)
"(c) 1999-2003, Matthew Chapman\n"
"(c) 2009, Collabora Ltd"));
aboutData.addAuthor(i18n("Urs Wolfer"), i18n("Developer, Maintainer"), QLatin1String("uwolfer@kde.org"));
aboutData.addAuthor(i18n("Tony Murray"), i18n("Developer"), QLatin1String("murraytony@gmail.com"));
aboutData.addAuthor(i18n("Tim Jansen"), i18n("Former Developer"), QLatin1String("tim@tjansen.de"));
aboutData.addAuthor(i18n("Arend van Beelen jr."), i18n("Initial RDP backend"), QLatin1String("arend@auton.nl"));
aboutData.addAuthor(i18n("Urs Wolfer"), i18n("Developer, Maintainer"), QStringLiteral("uwolfer@kde.org"));
aboutData.addAuthor(i18n("Tony Murray"), i18n("Developer"), QStringLiteral("murraytony@gmail.com"));
aboutData.addAuthor(i18n("Tim Jansen"), i18n("Former Developer"), QStringLiteral("tim@tjansen.de"));
aboutData.addAuthor(i18n("Arend van Beelen jr."), i18n("Initial RDP backend"), QStringLiteral("arend@auton.nl"));
aboutData.addCredit(i18n("Brad Hards"), i18n("Google Summer of Code 2007 KRDC project mentor"),
QLatin1String("bradh@frogmouth.net"));
QStringLiteral("bradh@frogmouth.net"));
aboutData.addCredit(i18n("LibVNCServer / LibVNCClient developers"), i18n("VNC client library"),
QLatin1String("libvncserver-common@lists.sf.net"), QLatin1String("http://libvncserver.sourceforge.net/"));
aboutData.addAuthor(i18n("Abner Silva"), i18n("Telepathy Tubes Integration"), QLatin1String("abner.silva@kdemail.net"));
QStringLiteral("libvncserver-common@lists.sf.net"), QStringLiteral("http://libvncserver.sourceforge.net/"));
aboutData.addAuthor(i18n("Abner Silva"), i18n("Telepathy Tubes Integration"), QStringLiteral("abner.silva@kdemail.net"));
aboutData.setOrganizationDomain("kde.org");
KAboutData::setApplicationData(aboutData);
......@@ -83,9 +83,9 @@ int main(int argc, char **argv)
aboutData.setupCommandLine(&parser);
// command line options
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("fullscreen"),
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("fullscreen"),
i18n("Start KRDC with the provided URL in fullscreen mode (works only with one URL)")));
parser.addPositionalArgument(QLatin1String("url"), i18n("URLs to connect after startup"));
parser.addPositionalArgument(QStringLiteral("url"), i18n("URLs to connect after startup"));
parser.process(app);
aboutData.processCommandLine(&parser);
......@@ -103,8 +103,8 @@ int main(int argc, char **argv)
if (arg.lastIndexOf(QLatin1Char('/')) != 0)
arg = arg.right(arg.length() - arg.lastIndexOf(QLatin1Char('/')) - 1);
if (!arg.contains(QLatin1String("://")))
arg.prepend(QLatin1String("vnc://")); // vnc was default in kde3 times...
if (!arg.contains(QStringLiteral("://")))
arg.prepend(QStringLiteral("vnc://")); // vnc was default in kde3 times...
qCDebug(KRDC) << "recovered url:" << arg;
......@@ -114,7 +114,7 @@ int main(int argc, char **argv)
continue;
}
mainwindow->newConnection(url, parser.isSet(QLatin1String("fullscreen")));
mainwindow->newConnection(url, parser.isSet(QStringLiteral("fullscreen")));
}
}
qCDebug(KRDC) << "########## KRDC ready:" << startupTimer.elapsed() << "ms ##########";
......
This diff is collapsed.
......@@ -25,7 +25,7 @@
#include "remotedesktopsmodel.h"
#include "logging.h"
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include<KCoreAddons/KFormat>
#include <DNSSD/ServiceBrowser>
#include <QDateTime>
......
......@@ -25,7 +25,7 @@
#include "mainwindow.h"
#include <KXmlGui/KActionCollection>
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#include <QMenu>
......
......@@ -23,7 +23,7 @@
#include "testviewfactory.h"
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(KrdcFactory, "krdc_test.json", registerPlugin<TestViewFactory>();)
......
......@@ -27,7 +27,7 @@
#ifdef QTONLY
#define i18n tr
#else
#include <KI18n/KLocalizedString>
#include <KLocalizedString>
#endif
#include "remoteview.h"
......
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