Commit d9cc51c1 authored by Michal Humpula's avatar Michal Humpula

add -DQT_NO_CAST_FROM_ASCII flags (11/11)

addons are out of the woods
parent bd6b0efd
# KTextEditor plugins, for the kate part
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_subdirectory (ktexteditor)
# Kate plugins
......
......@@ -57,7 +57,7 @@ KateKonsolePlugin::KateKonsolePlugin( QObject* parent, const QList<QVariant>& ):
KTextEditor::ApplicationPlugin ( parent )
{
m_previousEditorEnv=qgetenv("EDITOR");
if (!KAuthorized::authorizeKAction("shell_access"))
if (!KAuthorized::authorizeKAction(QLatin1String("shell_access")))
{
KMessageBox::sorry(0, i18n ("You do not have enough karma to access a shell or terminal emulation"));
}
......@@ -96,7 +96,7 @@ QString KateKonsolePlugin::configPageFullName (int number) const
QIcon KateKonsolePlugin::configPageIcon (int number) const
{
if (number != 0) return QIcon();
return QIcon::fromTheme("utilities-terminal");
return QIcon::fromTheme(QLatin1String("utilities-terminal"));
}
void KateKonsolePlugin::readConfig()
......@@ -109,7 +109,7 @@ KateKonsolePluginView::KateKonsolePluginView (KateKonsolePlugin* plugin, KTextEd
: QObject(mainWindow),m_plugin(plugin)
{
// init console
QWidget *toolview = mainWindow->createToolView (plugin, "kate_private_plugin_katekonsoleplugin", KTextEditor::MainWindow::Bottom, SmallIcon("utilities-terminal"), i18n("Terminal"));
QWidget *toolview = mainWindow->createToolView (plugin, QLatin1String("kate_private_plugin_katekonsoleplugin"), KTextEditor::MainWindow::Bottom, SmallIcon(QLatin1String("utilities-terminal")), i18n("Terminal"));
m_console = new KateConsole(m_plugin, mainWindow, toolview);
// register this view
......@@ -139,23 +139,23 @@ KateConsole::KateConsole (KateKonsolePlugin* plugin, KTextEditor::MainWindow *mw
, m_toolView (parent)
, m_plugin(plugin)
{
KXMLGUIClient::setComponentName ("kateconsole", i18n ("Kate Terminal"));
setXMLFile( "ui.rc" );
KXMLGUIClient::setComponentName (QLatin1String("kateconsole"), i18n ("Kate Terminal"));
setXMLFile( QLatin1String("ui.rc") );
// make sure we have a vertical layout
new QVBoxLayout(this);
QAction* a = actionCollection()->addAction("katekonsole_tools_pipe_to_terminal");
a->setIcon(QIcon::fromTheme("utilities-terminal"));
QAction* a = actionCollection()->addAction(QLatin1String("katekonsole_tools_pipe_to_terminal"));
a->setIcon(QIcon::fromTheme(QLatin1String("utilities-terminal")));
a->setText(i18nc("@action", "&Pipe to Terminal"));
connect(a, SIGNAL(triggered()), this, SLOT(slotPipeToConsole()));
a = actionCollection()->addAction("katekonsole_tools_sync");
a = actionCollection()->addAction(QLatin1String("katekonsole_tools_sync"));
a->setText(i18nc("@action", "S&ynchronize Terminal with Current Document"));
connect(a, SIGNAL(triggered()), this, SLOT(slotManualSync()));
a = actionCollection()->addAction("katekonsole_tools_toggle_focus");
a->setIcon(QIcon::fromTheme("utilities-terminal"));
a = actionCollection()->addAction(QLatin1String("katekonsole_tools_toggle_focus"));
a->setIcon(QIcon::fromTheme(QLatin1String("utilities-terminal")));
a->setText(i18nc("@action", "&Focus Terminal"));
connect(a, SIGNAL(triggered()), this, SLOT(slotToggleFocus()));
......@@ -179,7 +179,7 @@ void KateConsole::loadConsoleIfNeeded()
if (!window() || !isVisibleTo(window())) return;
KPluginFactory* factory = 0;
KService::Ptr service = KService::serviceByDesktopName("konsolepart");
KService::Ptr service = KService::serviceByDesktopName(QLatin1String("konsolepart"));
if (service) {
factory = KPluginLoader(service->library()).factory();
}
......@@ -241,7 +241,7 @@ void KateConsole::cd (const QString & path)
return;
m_currentPath = path;
sendInput("cd " + KShell::quoteArg(m_currentPath) + '\n');
sendInput(QLatin1String("cd ") + KShell::quoteArg(m_currentPath) + QLatin1Char('\n'));
}
void KateConsole::sendInput( const QString& text )
......@@ -263,7 +263,7 @@ void KateConsole::slotPipeToConsole ()
(m_mw->window()
, i18n ("Do you really want to pipe the text to the console? This will execute any contained commands with your user rights.")
, i18n ("Pipe to Terminal?")
, KGuiItem(i18n("Pipe to Terminal")), KStandardGuiItem::cancel(), "Pipe To Terminal Warning") != KMessageBox::Continue)
, KGuiItem(i18n("Pipe to Terminal")), KStandardGuiItem::cancel(), QLatin1String("Pipe To Terminal Warning")) != KMessageBox::Continue)
return;
KTextEditor::View *v = m_mw->activeView();
......@@ -285,7 +285,7 @@ void KateConsole::slotSync()
QFileInfo fi(u.toLocalFile());
cd(fi.absoluteFilePath() );
} else if ( !u.isEmpty() ) {
sendInput( "### " + i18n("Sorry, cannot cd into '%1'", u.toLocalFile() ) + '\n' );
sendInput( QLatin1String("### ") + i18n("Sorry, cannot cd into '%1'", u.toLocalFile() ) + QLatin1Char('\n') );
}
}
}
......@@ -299,7 +299,7 @@ void KateConsole::slotManualSync()
}
void KateConsole::slotToggleFocus()
{
QAction *action = actionCollection()->action("katekonsole_tools_toggle_focus");
QAction *action = actionCollection()->action(QLatin1String("katekonsole_tools_toggle_focus"));
if ( ! m_part ) {
m_mw->showToolView( parentWidget() );
action->setText( i18n("Defocus Terminal") );
......
......@@ -118,14 +118,14 @@ bool KateProject::reload (bool force)
/**
* no name, bad => bail out
*/
if (globalProject["name"].toString().isEmpty())
if (globalProject[QLatin1String("name")].toString().isEmpty())
return false;
/**
* support out-of-source project files
*/
if (!globalProject["directory"].toString().isEmpty())
m_baseDir = QFileInfo (globalProject["directory"].toString()).canonicalFilePath ();
if (!globalProject[QLatin1String("directory")].toString().isEmpty())
m_baseDir = QFileInfo (globalProject[QLatin1String("directory")].toString()).canonicalFilePath ();
/**
* anything changed?
......@@ -206,13 +206,13 @@ QFile *KateProject::projectLocalFile (const QString &file) const
/**
* create dir to store local files, else fail
*/
if (!QDir().mkpath (m_fileName+".d"))
if (!QDir().mkpath (m_fileName + QLatin1String(".d")))
return 0;
/**
* try to open file read-write
*/
QFile *readWriteFile = new QFile (m_fileName + ".d" + QDir::separator() + file);
QFile *readWriteFile = new QFile (m_fileName + QLatin1String(".d") + QDir::separator() + file);
if (!readWriteFile->open (QIODevice::ReadWrite)) {
delete readWriteFile;
return 0;
......@@ -241,7 +241,7 @@ QTextDocument* KateProject::notesDocument ()
/**
* and load text if possible
*/
if (QFile *inFile = projectLocalFile ("notes.txt")) {
if (QFile *inFile = projectLocalFile (QLatin1String("notes.txt"))) {
{
QTextStream inStream (inFile);
inStream.setCodec ("UTF-8");
......@@ -267,7 +267,7 @@ void KateProject::saveNotesDocument ()
/**
* try to get file to save to
*/
if (QFile *outFile = projectLocalFile ("notes.txt")) {
if (QFile *outFile = projectLocalFile (QLatin1String("notes.txt"))) {
outFile->resize (0);
{
QTextStream outStream (outFile);
......
......@@ -150,7 +150,7 @@ class KateProject : public QObject
*/
QString name () const
{
return m_projectMap["name"].toString ();
return m_projectMap[QLatin1String("name")].toString ();
}
/**
......
......@@ -62,7 +62,7 @@ QVariant KateProjectCompletion::data(const QModelIndex& index, int role) const
return m_matches.item ( index.row() )->data (Qt::DisplayRole);
if( index.column() == KTextEditor::CodeCompletionModel::Icon && role == Qt::DecorationRole ) {
static QIcon icon(QIcon::fromTheme("insert-text").pixmap(QSize(16, 16)));
static QIcon icon(QIcon::fromTheme(QLatin1String("insert-text")).pixmap(QSize(16, 16)));
return icon;
}
......@@ -122,7 +122,7 @@ bool KateProjectCompletion::shouldStartCompletion(KTextEditor::View* view, const
if (end<0) return false;
for (int i=start-1;i>=end;i--) {
QChar c=text.at(i);
if (! (c.isLetter() || (c.isNumber()) || c=='_') ) return false;
if (! (c.isLetter() || (c.isNumber()) || c==QLatin1Char('_')) ) return false;
}
return true;
......@@ -193,7 +193,7 @@ KTextEditor::Range KateProjectCompletion::completionRange(KTextEditor::View* vie
while ( col > 0 )
{
QChar c = ( doc->characterAt( KTextEditor::Cursor( line, col-1 ) ) );
if ( c.isLetterOrNumber() || c.isMark() || c == '_' )
if ( c.isLetterOrNumber() || c.isMark() || c == QLatin1Char('_') )
{
col--;
continue;
......
......@@ -29,7 +29,7 @@
#include "ctags/readtags.c"
KateProjectIndex::KateProjectIndex (const QStringList &files)
: m_ctagsIndexFile (QDir::tempPath () + "/kate.project.ctags")
: m_ctagsIndexFile (QDir::tempPath () + QLatin1String("/kate.project.ctags"))
, m_ctagsIndexHandle (0)
{
/**
......@@ -69,15 +69,15 @@ void KateProjectIndex::loadCtags (const QStringList &files)
*/
QProcess ctags;
QStringList args;
args << "-L" << "-" << "-f" << m_ctagsIndexFile.fileName() << "--fields=+K+n";
ctags.start("ctags", args);
args << QLatin1String("-L") << QLatin1String("-") << QLatin1String("-f") << m_ctagsIndexFile.fileName() << QLatin1String("--fields=+K+n");
ctags.start(QLatin1String("ctags"), args);
if (!ctags.waitForStarted())
return;
/**
* write files list and close write channel
*/
ctags.write(files.join("\n").toLocal8Bit());
ctags.write(files.join(QLatin1String("\n")).toLocal8Bit());
ctags.closeWriteChannel();
/**
......@@ -183,7 +183,7 @@ void KateProjectIndex::findMatches (QStandardItemModel &model, const QString &se
items << new QStandardItem (name);
items << new QStandardItem (entry.kind ? QString::fromLocal8Bit(entry.kind) : QString());
items << new QStandardItem (entry.file ? QString::fromLocal8Bit(entry.file) : QString());
items << new QStandardItem (QString("%1").arg(entry.address.lineNumber));
items << new QStandardItem (QString::number(entry.address.lineNumber));
model.appendRow (items);
break;
}
......
......@@ -45,7 +45,7 @@ KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis (KateProjectPlu
m_treeView->setEditTriggers (QAbstractItemView::NoEditTriggers);
m_treeView->setUniformRowHeights (true);
m_treeView->setRootIsDecorated (false);
m_model->setHorizontalHeaderLabels (QStringList () << "File" << "Line" << "Severity" << "Message");
m_model->setHorizontalHeaderLabels (QStringList () << QLatin1String("File") << QLatin1String("Line") << QLatin1String("Severity") << QLatin1String("Message"));
/**
* attach model
......@@ -84,7 +84,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked ()
/**
* get files for cppcheck
*/
QStringList files = m_project->files ().filter (QRegExp ("\\.(cpp|cxx|cc|c\\+\\+|c|tpp|txx)$"));
QStringList files = m_project->files ().filter (QRegExp (QLatin1String("\\.(cpp|cxx|cc|c\\+\\+|c|tpp|txx)$")));
/**
* clear existing entries
......@@ -100,8 +100,8 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked ()
connect (m_analyzer, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
QStringList args;
args << "-q" << "--inline-suppr" << "--enable=all" << "--template={file}////{line}////{severity}////{message}" << "--file-list=-";
m_analyzer->start("cppcheck", args);
args << QLatin1String("-q") << QLatin1String("--inline-suppr") << QLatin1String("--enable=all") << QLatin1String("--template={file}////{line}////{severity}////{message}") << QLatin1String("--file-list=-");
m_analyzer->start(QLatin1String("cppcheck"), args);
if (m_messageWidget) {
delete m_messageWidget;
......@@ -121,7 +121,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked ()
/**
* write files list and close write channel
*/
m_analyzer->write(files.join("\n").toLocal8Bit());
m_analyzer->write(files.join(QLatin1String("\n")).toLocal8Bit());
m_analyzer->closeWriteChannel();
}
......@@ -135,7 +135,7 @@ void KateProjectInfoViewCodeAnalysis::slotReadyRead ()
* get one line, split it, skip it, if too few elements
*/
QString line = QString::fromLocal8Bit (m_analyzer->readLine());
QStringList elements = line.split (QRegExp("////"), QString::SkipEmptyParts);
QStringList elements = line.split (QRegExp(QLatin1String("////")), QString::SkipEmptyParts);
if (elements.size() < 4)
continue;
......
......@@ -63,7 +63,7 @@ void KateProjectInfoViewTerminal::loadTerminal ()
/**
* get konsole part service
*/
KService::Ptr service = KService::serviceByDesktopName("konsolepart");
KService::Ptr service = KService::serviceByDesktopName(QLatin1String("konsolepart"));
if (!service)
return;
......
......@@ -59,9 +59,9 @@ void KateProjectItem::slotModifiedChanged(KTextEditor::Document *doc)
if (m_emblem) {
QStringList emblems;
emblems << *m_emblem;
m_icon = new QIcon (KIconLoader::global ()->loadIcon ("document-save" , KIconLoader::Small, 0, KIconLoader::DefaultState, emblems));
m_icon = new QIcon (KIconLoader::global ()->loadIcon (QLatin1String("document-save") , KIconLoader::Small, 0, KIconLoader::DefaultState, emblems));
} else {
m_icon = new QIcon (KIconLoader::global ()->loadIcon ("document-save", KIconLoader::Small));
m_icon = new QIcon (KIconLoader::global ()->loadIcon (QLatin1String("document-save"), KIconLoader::Small));
}
}
emitDataChanged();
......@@ -84,7 +84,7 @@ void KateProjectItem::slotModifiedOnDisk (KTextEditor::Document *document,
}
if (reason != KTextEditor::ModificationInterface::OnDiskUnmodified) {
m_emblem = new QString("emblem-important");
m_emblem = new QString(QLatin1String("emblem-important"));
}
emitDataChanged();
}
......@@ -111,11 +111,11 @@ QVariant KateProjectItem::data (int role) const
*/
switch (m_type) {
case Project:
m_icon = new QIcon (KIconLoader::global ()->loadIcon ("folder-documents", KIconLoader::Small));
m_icon = new QIcon (KIconLoader::global ()->loadIcon (QLatin1String("folder-documents"), KIconLoader::Small));
break;
case Directory:
m_icon = new QIcon (KIconLoader::global ()->loadIcon ("folder", KIconLoader::Small));
m_icon = new QIcon (KIconLoader::global ()->loadIcon (QLatin1String("folder"), KIconLoader::Small));
break;
case File: {
......
......@@ -151,14 +151,14 @@ KateProject *KateProjectPlugin::projectForDir (QDir dir)
* check for project and load it if found
*/
QString canonicalPath = dir.canonicalPath();
QString canonicalFileName = canonicalPath + QString("/.kateproject");
QString canonicalFileName = canonicalPath + QLatin1String("/.kateproject");
foreach (KateProject *project, m_projects) {
if (project->baseDir() == canonicalPath || project->fileName() == canonicalFileName)
return project;
}
if (dir.exists (".kateproject"))
if (dir.exists (QLatin1String(".kateproject")))
return createProjectForFileName (canonicalFileName);
/**
......@@ -250,7 +250,7 @@ void KateProjectPlugin::slotDirectoryChanged (const QString &path)
/**
* auto-reload, if there
*/
QString fileName = path + QString("/.kateproject");
QString fileName = path + QLatin1String("/.kateproject");
foreach (KateProject *project, m_projects) {
if (project->fileName() == fileName) {
project->reload();
......
......@@ -46,21 +46,21 @@ KateProjectPluginView::KateProjectPluginView( KateProjectPlugin *plugin, KTextEd
, m_plugin (plugin)
, m_mainWindow (mainWin)
{
KXMLGUIClient::setComponentName ("kateproject", i18n ("Kate Project Manager"));
setXMLFile( "ui.rc" );
KXMLGUIClient::setComponentName (QLatin1String("kateproject"), i18n ("Kate Project Manager"));
setXMLFile( QLatin1String("ui.rc") );
/**
* create toolviews
*/
m_toolView = m_mainWindow->createToolView (m_plugin, "kateproject", KTextEditor::MainWindow::Left, SmallIcon("project-open"), i18n("Projects"));
m_toolInfoView = m_mainWindow->createToolView (m_plugin, "kateprojectinfo", KTextEditor::MainWindow::Bottom, SmallIcon("view-choose"), i18n("Current Project"));
m_toolView = m_mainWindow->createToolView (m_plugin, QLatin1String("kateproject"), KTextEditor::MainWindow::Left, SmallIcon(QLatin1String("project-open")), i18n("Projects"));
m_toolInfoView = m_mainWindow->createToolView (m_plugin, QLatin1String("kateprojectinfo"), KTextEditor::MainWindow::Bottom, SmallIcon(QLatin1String("view-choose")), i18n("Current Project"));
/**
* create the combo + buttons for the toolViews + stacked widgets
*/
m_projectsCombo = new QComboBox (m_toolView);
m_reloadButton = new QToolButton (m_toolView);
m_reloadButton->setIcon (SmallIcon("view-refresh"));
m_reloadButton->setIcon (SmallIcon(QLatin1String("view-refresh")));
QHBoxLayout *layout = new QHBoxLayout ();
layout->setSpacing (0);
layout->addWidget (m_projectsCombo);
......@@ -99,8 +99,8 @@ KateProjectPluginView::KateProjectPluginView( KateProjectPlugin *plugin, KTextEd
/**
* back + forward
*/
actionCollection()->addAction (KStandardAction::Back, "projects_prev_project", this, SLOT(slotProjectPrev()))->setShortcut (Qt::CTRL | Qt::ALT | Qt::Key_Left);
actionCollection()->addAction (KStandardAction::Forward, "projects_next_project", this, SLOT(slotProjectNext()))->setShortcut (Qt::CTRL | Qt::ALT | Qt::Key_Right);
actionCollection()->addAction (KStandardAction::Back, QLatin1String("projects_prev_project"), this, SLOT(slotProjectPrev()))->setShortcut (Qt::CTRL | Qt::ALT | Qt::Key_Left);
actionCollection()->addAction (KStandardAction::Forward, QLatin1String("projects_next_project"), this, SLOT(slotProjectNext()))->setShortcut (Qt::CTRL | Qt::ALT | Qt::Key_Right);
/**
* add us to gui
......@@ -156,7 +156,7 @@ QPair<KateProjectView *,KateProjectInfoView *> KateProjectPluginView::viewForPro
*/
m_stackedProjectViews->addWidget (view);
m_stackedProjectInfoViews->addWidget (infoView);
m_projectsCombo->addItem (SmallIcon("project-open"), project->name(), project->fileName());
m_projectsCombo->addItem (SmallIcon(QLatin1String("project-open")), project->name(), project->fileName());
/**
* remember and return it
......
......@@ -49,11 +49,11 @@ static bool isGit(const QString& filename)
QProcess git;
git.setWorkingDirectory (dir.absolutePath());
QStringList args;
args << "ls-files" << fi.fileName();
git.start("git", args);
args << QLatin1String("ls-files") << fi.fileName();
git.start(QLatin1String("git"), args);
bool isGit = false;
if (git.waitForStarted() && git.waitForFinished()) {
QStringList files = QString::fromLocal8Bit (git.readAllStandardOutput ()).split (QRegExp("[\n\r]"), QString::SkipEmptyParts);
QStringList files = QString::fromLocal8Bit (git.readAllStandardOutput ()).split (QRegExp(QLatin1String("[\n\r]")), QString::SkipEmptyParts);
isGit = files.contains(fi.fileName());
}
return isGit;
......@@ -82,7 +82,7 @@ void KateProjectTreeViewContextMenu::exec(const QString& filename, const QPoint&
*/
QMenu menu;
QAction *copyAction = menu.addAction(QIcon::fromTheme("edit-copy"), i18n("Copy Filename"));
QAction *copyAction = menu.addAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18n("Copy Filename"));
/**
* handle "open with"
......@@ -90,7 +90,7 @@ void KateProjectTreeViewContextMenu::exec(const QString& filename, const QPoint&
*/
QMenu *openWithMenu = menu.addMenu(i18n("Open With"));
QMimeType mimeType = QMimeDatabase().mimeTypeForFile(filename);
KService::List offers = KMimeTypeTrader::self()->query(mimeType.name(), "Application");
KService::List offers = KMimeTypeTrader::self()->query(mimeType.name(), QLatin1String("Application"));
/**
* for each one, insert a menu item...
......@@ -98,7 +98,7 @@ void KateProjectTreeViewContextMenu::exec(const QString& filename, const QPoint&
for(KService::List::Iterator it = offers.begin(); it != offers.end(); ++it)
{
KService::Ptr service = *it;
if (service->name() == "Kate") continue; // omit Kate
if (service->name() == QLatin1String("Kate")) continue; // omit Kate
QAction *action = openWithMenu->addAction(QIcon::fromTheme(service->icon()), service->name());
action->setData(service->entryPath());
}
......@@ -111,19 +111,19 @@ void KateProjectTreeViewContextMenu::exec(const QString& filename, const QPoint&
QList<QAction*> appActions;
if (isGit(filename)) {
QMenu* git = menu.addMenu(i18n("Git Tools"));
if (appExists("gitk")) {
if (appExists(QLatin1String("gitk"))) {
QAction* action = git->addAction(i18n("Launch gitk"));
action->setData("gitk");
action->setData(QLatin1String("gitk"));
appActions.append(action);
}
if (appExists("qgit")) {
if (appExists(QLatin1String("qgit"))) {
QAction* action = git->addAction(i18n("Launch qgit"));
action->setData("qgit");
action->setData(QLatin1String("qgit"));
appActions.append(action);
}
if (appExists("git-cola")) {
if (appExists(QLatin1String("git-cola"))) {
QAction* action = git->addAction(i18n("Launch git-cola"));
action->setData("git-cola");
action->setData(QLatin1String("git-cola"));
appActions.append(action);
}
......
......@@ -77,19 +77,19 @@ void KateProjectWorker::loadProject (QStandardItem *parent, const QVariantMap &p
/**
* recurse to sub-projects FIRST
*/
QVariantList subGroups = project["projects"].toList ();
QVariantList subGroups = project[QLatin1String("projects")].toList ();
foreach (const QVariant &subGroupVariant, subGroups) {
/**
* convert to map and get name, else skip
*/
QVariantMap subProject = subGroupVariant.toMap ();
if (subProject["name"].toString().isEmpty())
if (subProject[QLatin1String("name")].toString().isEmpty())
continue;
/**
* recurse
*/
QStandardItem *subProjectItem = new KateProjectItem (KateProjectItem::Project, subProject["name"].toString());
QStandardItem *subProjectItem = new KateProjectItem (KateProjectItem::Project, subProject[QLatin1String("name")].toString());
loadProject (subProjectItem, subProject, file2Item);
parent->appendRow (subProjectItem);
}
......@@ -97,7 +97,7 @@ void KateProjectWorker::loadProject (QStandardItem *parent, const QVariantMap &p
/**
* load all specified files
*/
QVariantList files = project["files"].toList ();
QVariantList files = project[QLatin1String("files")].toList ();
foreach (const QVariant &fileVariant, files)
loadFilesEntry (parent, fileVariant.toMap (), file2Item);
}
......@@ -113,8 +113,8 @@ static QStandardItem *directoryParent (QMap<QString, QStandardItem *> &dir2Item,
/**
* throw away simple /
*/
if (path == "/")
path = "";
if (path == QLatin1String("/"))
path = QString();
/**
* quick check: dir already seen?
......@@ -125,7 +125,7 @@ static QStandardItem *directoryParent (QMap<QString, QStandardItem *> &dir2Item,
/**
* else: construct recursively
*/
int slashIndex = path.lastIndexOf ('/');
int slashIndex = path.lastIndexOf (QLatin1Char('/'));
/**
* no slash?
......@@ -133,7 +133,7 @@ static QStandardItem *directoryParent (QMap<QString, QStandardItem *> &dir2Item,
*/
if (slashIndex < 0) {
dir2Item[path] = new KateProjectItem (KateProjectItem::Directory, path);
dir2Item[""]->appendRow (dir2Item[path]);
dir2Item[QString()]->appendRow (dir2Item[path]);
return dir2Item[path];
}
......@@ -163,13 +163,13 @@ void KateProjectWorker::loadFilesEntry (QStandardItem *parent, const QVariantMap
* get directory to open or skip
*/
QDir dir (m_baseDir);
if (!dir.cd (filesEntry["directory"].toString()))
if (!dir.cd (filesEntry[QLatin1String("directory")].toString()))
return;
/**
* get recursive attribute, default is TRUE
*/
const bool recursive = !filesEntry.contains ("recursive") || filesEntry["recursive"].toBool();
const bool recursive = !filesEntry.contains (QLatin1String("recursive")) || filesEntry[QLatin1String("recursive")].toBool();
/**
* now: choose between different methodes to get files in the directory
......@@ -179,22 +179,22 @@ void KateProjectWorker::loadFilesEntry (QStandardItem *parent, const QVariantMap
/**
* use GIT
*/
if (filesEntry["git"].toBool()) {
if (filesEntry[QLatin1String("git")].toBool()) {
/**
* try to run git with ls-files for this directory
*/
QProcess git;
git.setWorkingDirectory (dir.absolutePath());
QStringList args;
args << "ls-files" << ".";
git.start("git", args);
args << QLatin1String("ls-files") << QLatin1String(".");
git.start(QLatin1String("git"), args);
if (!git.waitForStarted() || !git.waitForFinished())
return;
/**
* get output and split up into files
*/
QStringList relFiles = QString::fromLocal8Bit (git.readAllStandardOutput ()).split (QRegExp("[\n\r]"), QString::SkipEmptyParts);
QStringList relFiles = QString::fromLocal8Bit (git.readAllStandardOutput ()).split (QRegExp(QLatin1String("[\n\r]")), QString::SkipEmptyParts);
/**
* prepend the directory path
......@@ -203,32 +203,32 @@ void KateProjectWorker::loadFilesEntry (QStandardItem *parent, const QVariantMap
/**
* skip non-direct files if not recursive
*/
if (!recursive && (relFile.indexOf ("/") != -1))
if (!recursive && (relFile.indexOf (QLatin1String("/")) != -1))
continue;
files.append (dir.absolutePath() + '/' + relFile);
files.append (dir.absolutePath() + QLatin1Char('/') + relFile);
}
}
/**
* use MERCURIAL
*/
else if (filesEntry["hg"].toBool()) {
else if (filesEntry[QLatin1String("hg")].toBool()) {
/**
* try to run "hg manifest" for this directory
* try to run QLatin1String("hg manifest") for this directory
*/
QProcess hg;
hg.setWorkingDirectory (dir.absolutePath());
QStringList args;
args << "manifest" << ".";
hg.start("hg", args);
args << QLatin1String("manifest") << QLatin1String(".");
hg.start(QLatin1String("hg"), args);
if (!hg.waitForStarted() || !hg.waitForFinished())
return;
/**
* get output and split up into files
*/
QStringList relFiles = QString::fromLocal8Bit (hg.readAllStandardOutput ()).split (QRegExp("[\n\r]"), QString::SkipEmptyParts);
QStringList relFiles = QString::fromLocal8Bit (hg.readAllStandardOutput ()).split (QRegExp(QLatin1String("[\n\r]")), QString::SkipEmptyParts);
/**
* prepend the directory path
......@@ -237,36 +237,36 @@ void KateProjectWorker::loadFilesEntry (QStandardItem *parent, const QVariantMap
/**