Commit 006353a0 authored by Laurent Montel's avatar Laurent Montel 😁

Start to compile with "-DQT_NO_CAST_FROM_ASCII" and " -DQT_NO_CAST_TO_ASCII"

svn path=/trunk/kdereview/filelight/; revision=1174600
parent a727b859
......@@ -61,12 +61,12 @@ QString HistoryAction::pop()
HistoryCollection::HistoryCollection(KActionCollection *ac, QObject *parent)
: QObject(parent)
, m_b(new HistoryAction(KIcon("go-previous"), i18nc("Go to the last path viewed", "Back"), ac))
, m_f(new HistoryAction(KIcon("go-next"), i18nc("Go to forward in the history of paths viewed", "Forward"), ac))
, m_b(new HistoryAction(KIcon(QLatin1String( "go-previous" )), i18nc("Go to the last path viewed", "Back"), ac))
, m_f(new HistoryAction(KIcon(QLatin1String( "go-next" )), i18nc("Go to forward in the history of paths viewed", "Forward"), ac))
, m_receiver(0)
{
ac->addAction("go_back", m_b);
ac->addAction("go_forward", m_f);
ac->addAction(QLatin1String( "go_back" ), m_b);
ac->addAction(QLatin1String( "go_forward" ), m_f);
connect(m_b, SIGNAL(triggered(bool)), SLOT(pop()));
connect(m_f, SIGNAL(triggered(bool)), SLOT(pop()));
}
......
......@@ -56,7 +56,7 @@ namespace Filelight {
MainWindow::MainWindow() : KParts::MainWindow(), m_part(0)
{
// setXMLFile("filelightui.rc");
KPluginFactory *factory = KPluginLoader("filelightpart").factory();
KPluginFactory *factory = KPluginLoader(QLatin1String( "filelightpart" )).factory();
if (!factory) {
KMessageBox::error(this, i18n("Unable to load the Filelight Part.\nPlease make sure Filelight was correctly installed."));
......@@ -72,7 +72,7 @@ MainWindow::MainWindow() : KParts::MainWindow(), m_part(0)
createGUI(m_part);
setCentralWidget(m_part->widget());
stateChanged("scan_failed"); //bah! doesn't affect the parts' actions, should I add them to the actionCollection here?
stateChanged(QLatin1String( "scan_failed" )); //bah! doesn't affect the parts' actions, should I add them to the actionCollection here?
connect(m_part, SIGNAL(started(KIO::Job*)), SLOT(scanStarted()));
connect(m_part, SIGNAL(completed()), SLOT(scanCompleted()));
......@@ -88,7 +88,7 @@ MainWindow::MainWindow() : KParts::MainWindow(), m_part(0)
std::exit(1);
}
setAutoSaveSettings("window");
setAutoSaveSettings(QLatin1String( "window" ));
}
inline void MainWindow::setupActions() //singleton function
......@@ -109,37 +109,37 @@ inline void MainWindow::setupActions() //singleton function
KAction* action;
action = ac->addAction("scan_home", this, SLOT(slotScanHomeFolder()));
action = ac->addAction(QLatin1String( "scan_home" ), this, SLOT(slotScanHomeFolder()));
action->setText(i18n("Scan &Home Folder"));
action->setIcon(KIcon("user-home"));
action->setIcon(KIcon(QLatin1String( "user-home" )));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Home));
action = ac->addAction("scan_root", this, SLOT(slotScanRootFolder()));
action = ac->addAction(QLatin1String( "scan_root" ), this, SLOT(slotScanRootFolder()));
action->setText(i18n("Scan &Root Folder"));
action->setIcon(KIcon("folder-red"));
action->setIcon(KIcon(QLatin1String( "folder-red" )));
action = ac->addAction("scan_rescan", m_part, SLOT(rescan()));
action = ac->addAction(QLatin1String( "scan_rescan" ), m_part, SLOT(rescan()));
action->setText(i18n("Rescan"));
action->setIcon(KIcon("view-refresh"));
action->setIcon(KIcon(QLatin1String( "view-refresh" )));
action->setShortcut(KStandardShortcut::reload());
action = ac->addAction("scan_stop", this, SLOT(slotAbortScan()));
action = ac->addAction(QLatin1String( "scan_stop" ), this, SLOT(slotAbortScan()));
action->setText(i18n("Stop"));
action->setIcon(KIcon("process-stop"));
action->setIcon(KIcon(QLatin1String( "process-stop" )));
action->setShortcut(Qt::Key_Escape);
action = ac->addAction("go", m_combo, SIGNAL(returnPressed()));
action = ac->addAction(QLatin1String( "go" ), m_combo, SIGNAL(returnPressed()));
action->setText(i18n("Go"));
action->setIcon(KIcon("go-jump-locationbar"));
action->setIcon(KIcon(QLatin1String( "go-jump-locationbar" )));
action = ac->addAction("location_bar", 0, 0);
action = ac->addAction(QLatin1String( "location_bar" ), 0, 0);
action->setText(i18n("Location Bar"));
action->setDefaultWidget(m_combo);
action = ac->addAction("scan_folder", this, SLOT(slotScanFolder()));
action = ac->addAction(QLatin1String( "scan_folder" ), this, SLOT(slotScanFolder()));
action->setText(i18n("Scan Folder"));
action->setIcon(KIcon("folder"));
action->setIcon(KIcon(QLatin1String( "folder" )));
m_recentScans = new KRecentFilesAction(i18n("&Recent Scans"), ac);
m_recentScans->setMaxItems(8);
......@@ -205,7 +205,7 @@ inline void MainWindow::slotComboScan()
KUrl url = KUrl(path);
if (url.isRelative())
path = "~/" + path; // KUrlCompletion completes relative to ~, not CWD
path = QLatin1String( "~/" ) + path; // KUrlCompletion completes relative to ~, not CWD
path = KShell::tildeExpand(path);
......@@ -238,13 +238,13 @@ inline void MainWindow::slotAbortScan()
inline void MainWindow::scanStarted()
{
stateChanged("scan_started");
stateChanged(QLatin1String( "scan_started" ));
m_combo->clearFocus();
}
inline void MainWindow::scanFailed()
{
stateChanged("scan_failed");
stateChanged(QLatin1String( "scan_failed" ));
setActionMenuTextOnly(qobject_cast<KAction *>(action("go_up")), QString());
m_combo->lineEdit()->clear();
}
......@@ -254,11 +254,11 @@ void MainWindow::scanCompleted()
KAction *goUp = qobject_cast<KAction *>(action("go_up"));
const KUrl url = m_part->url();
stateChanged("scan_complete");
stateChanged(QLatin1String( "scan_complete" ));
m_combo->lineEdit()->setText(m_part->prettyUrl());
if (url.path(KUrl::LeaveTrailingSlash) == "/") {
if (url.path(KUrl::LeaveTrailingSlash) == QLatin1String( "/" )) {
goUp->setEnabled(false);
setActionMenuTextOnly(goUp, QString());
}
......
......@@ -61,7 +61,7 @@ public:
virtual bool closeUrl();
QString prettyUrl() const {
return url().protocol() == "file" ? url().path() : url().prettyUrl();
return url().protocol() == QLatin1String( "file" ) ? url().path() : url().prettyUrl();
}
public slots:
......
......@@ -171,7 +171,7 @@ void RadialMap::Map::colorise()
for (Iterator<Segment> it = m_signature[i].iterator(); it != m_signature[i].end(); ++it)
{
if (m_summary){ // Summary view has its own colors.
if ((*it)->file()->name() == "Used") {
if ((*it)->file()->name() == QLatin1String("Used")) {
cb = QApplication::palette().highlight().color();
cb.getHsv(&h, &s1, &v1);
......
......@@ -73,10 +73,10 @@ SegmentTip::updateTip(const File* const file, const Folder* const root)
uint maxw = 0;
uint h = fontMetrics().height()*2 + 2*MARGIN;
if (pc > 0) s2 += QString(" (%1%)").arg(loc->formatNumber(pc, 0));
if (pc > 0) s2 += QString(QLatin1String( " (%1%)" )).arg(loc->formatNumber(pc, 0));
m_text = s1;
m_text += '\n';
m_text += QLatin1Char( '\n' );
m_text += s2;
if (file->isFolder())
......@@ -85,11 +85,11 @@ SegmentTip::updateTip(const File* const file, const Folder* const root)
const uint pc = uint((100 * files) / (double)root->children());
QString s3 = i18np("File: %1", "Files: %1", files);
if (pc > 0) s3 += QString(" (%1%)").arg(loc->formatNumber(pc, 0));
if (pc > 0) s3 += QString(QLatin1String( " (%1%)" )).arg(loc->formatNumber(pc, 0));
maxw = fontMetrics().width(s3);
h += fontMetrics().height();
m_text += '\n';
m_text += QLatin1Char( '\n' );
m_text += s3;
}
......
......@@ -197,29 +197,29 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
popup.addTitle(m_focus->file()->fullPath(m_tree));
if (isDir) {
openFileManager = popup.addAction(KIcon("system-file-manager"), i18n("Open &File Manager Here"));
openFileManager = popup.addAction(KIcon(QLatin1String( "system-file-manager" )), i18n("Open &File Manager Here"));
if (url.protocol() == "file")
openTerminal = popup.addAction(KIcon("utilities-terminal"), i18n("Open &Terminal Here"));
if (url.protocol() == QLatin1String("file" ))
openTerminal = popup.addAction(KIcon(QLatin1String( "utilities-terminal" )), i18n("Open &Terminal Here"));
if (m_focus->file() != m_tree) {
popup.addSeparator();
centerMap = popup.addAction(KIcon("zoom-in"), i18n("&Center Map Here"));
centerMap = popup.addAction(KIcon(QLatin1String( "zoom-in" )), i18n("&Center Map Here"));
}
}
else
openFile = popup.addAction(KIcon("document-open"), i18nc("Scan/open the path of the selected element", "&Open"));
openFile = popup.addAction(KIcon(QLatin1String( "document-open" )), i18nc("Scan/open the path of the selected element", "&Open"));
popup.addSeparator();
copyClipboard = popup.addAction(KIcon("edit-copy"), i18n("&Copy to clipboard"));
copyClipboard = popup.addAction(KIcon(QLatin1String( "edit-copy" )), i18n("&Copy to clipboard"));
popup.addSeparator();
deleteItem = popup.addAction(KIcon("edit-delete"), i18n("&Delete"));
deleteItem = popup.addAction(KIcon(QLatin1String( "edit-delete" )), i18n("&Delete"));
QAction* clicked = popup.exec(e->globalPos(), 0);
if (openFileManager && clicked == openFileManager) {
KRun::runUrl(url.url(),"inode/directory", this);
KRun::runUrl(url.url(),QLatin1String( "inode/directory" ), this);
} else if (openTerminal && clicked == openTerminal) {
KToolInvocation::invokeTerminal(QString(),url.path());
} else if (centerMap && clicked == centerMap) {
......@@ -238,7 +238,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
: i18n("<qt><i>'%1'</i> will be <b>permanently</b> deleted.</qt>", url.prettyUrl());
const int userIntention = KMessageBox::warningContinueCancel(
this, message,
QString(), KGuiItem(i18n("&Delete"), "edit-delete"));
QString(), KGuiItem(i18n("&Delete"), QLatin1String( "edit-delete" )));
if (userIntention == KMessageBox::Continue) {
KIO::Job *job = KIO::del(url);
......@@ -306,7 +306,7 @@ void RadialMap::Widget::dragEnterEvent(QDragEnterEvent *e)
void RadialMap::Widget::changeEvent(QEvent *e)
{
if (e->type() == QEvent::ApplicationPaletteChange ||
if (e->type() == QEvent::ApplicationPaletteChange ||
e->type() == QEvent::PaletteChange)
m_map.paint();
}
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