No cast from ascii

parent 5f12f12e
......@@ -59,13 +59,13 @@ KompareShell::KompareShell()
resize( 800, 480 );
// set the shell's ui resource file
setXMLFile("kompareui.rc");
setXMLFile(QStringLiteral("kompareui.rc"));
// then, setup our actions
setupActions();
setupStatusBar();
m_viewPart = KMimeTypeTrader::createInstanceFromQuery<KParts::ReadWritePart>("text/x-patch", "Kompare/ViewPart", this);
m_viewPart = KMimeTypeTrader::createInstanceFromQuery<KParts::ReadWritePart>(QStringLiteral("text/x-patch"), QStringLiteral("Kompare/ViewPart"), this);
if ( m_viewPart )
{
......@@ -82,11 +82,11 @@ KompareShell::KompareShell()
}
m_navTreeDock = new QDockWidget( i18n( "Navigation" ), this );
m_navTreeDock->setObjectName( "Navigation" );
m_navTreeDock->setObjectName(QStringLiteral("Navigation"));
// This part is implemented in KompareNavTreePart
m_navTreePart = KServiceTypeTrader::createInstanceFromQuery<KParts::ReadOnlyPart>
("KParts/ReadOnlyPart", "'Kompare/NavigationPart' in ServiceTypes", m_navTreeDock);
(QStringLiteral("KParts/ReadOnlyPart"), QStringLiteral("'Kompare/NavigationPart' in ServiceTypes"), m_navTreeDock);
if ( m_navTreePart )
{
......@@ -142,7 +142,7 @@ KompareShell::KompareShell()
this, SLOT(slotSetDiffString(const QString&)) );
// Read basic main-view settings, and set to autosave
setAutoSaveSettings( "General Options" );
setAutoSaveSettings(QStringLiteral("General Options"));
}
KompareShell::~KompareShell()
......@@ -204,11 +204,11 @@ void KompareShell::setupActions()
QAction *a;
a = actionCollection()->addAction(KStandardAction::Open, this, SLOT(slotFileOpen()));
a->setText( i18n( "&Open Diff..." ) );
a = actionCollection()->addAction("file_compare_files", this, SLOT(slotFileCompareFiles()));
a->setIcon(QIcon::fromTheme("document-open"));
a = actionCollection()->addAction(QStringLiteral("file_compare_files"), this, SLOT(slotFileCompareFiles()));
a->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
a->setText(i18n("&Compare Files..."));
actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_C));
a = actionCollection()->addAction("file_blend_url", this, SLOT(slotFileBlendURLAndDiff()));
a = actionCollection()->addAction(QStringLiteral("file_blend_url"), this, SLOT(slotFileBlendURLAndDiff()));
a->setText(i18n("&Blend URL with Diff..."));
actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_B));
actionCollection()->addAction(KStandardAction::Quit, this, SLOT( slotFileClose() ));
......@@ -218,7 +218,7 @@ void KompareShell::setupActions()
m_showTextView = new KToggleAction(i18n("Show T&ext View"), this);
// needs a KGuiItem, also the doc says explicitly not to do this
// m_showTextView->setCheckedState(i18n("Hide T&ext View"));
actionCollection()->addAction("options_show_text_view", m_showTextView);
actionCollection()->addAction(QStringLiteral("options_show_text_view"), m_showTextView);
connect(m_showTextView, SIGNAL(triggered(bool)), SLOT(slotShowTextView()));
KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
......@@ -293,20 +293,20 @@ void KompareShell::readProperties(const KConfigGroup &config)
// in 'saveProperties'
QString mode = config.readEntry( "Mode", "ComparingFiles" );
if ( mode == "ComparingFiles" )
if ( mode == QLatin1String("ComparingFiles"))
{
m_mode = Kompare::ComparingFiles;
m_sourceURL = config.readPathEntry( "SourceUrl", "" );
m_destinationURL = config.readPathEntry( "DestinationFile", "" );
m_sourceURL = config.readPathEntry("SourceUrl", QString());
m_destinationURL = config.readPathEntry("DestinationFile", QString());
viewPart()->readProperties( const_cast<KConfig *>(config.config()) );
viewPart()->compareFiles( m_sourceURL, m_destinationURL );
}
else if ( mode == "ShowingDiff" )
else if ( mode == QLatin1String("ShowingDiff"))
{
m_mode = Kompare::ShowingDiff;
m_diffURL = config.readPathEntry( "DiffUrl", "" );
m_diffURL = config.readPathEntry("DiffUrl", QString());
viewPart()->readProperties( const_cast<KConfig *>(config.config()) );
......@@ -323,7 +323,7 @@ void KompareShell::readProperties(const KConfigGroup &config)
void KompareShell::slotFileOpen()
{
// FIXME: use different filedialog which gets encoding
QUrl url = QFileDialog::getOpenFileUrl( this, QString(), QUrl(), QMimeDatabase().mimeTypeForName("text/x-patch").filterString() );
QUrl url = QFileDialog::getOpenFileUrl( this, QString(), QUrl(), QMimeDatabase().mimeTypeForName(QStringLiteral("text/x-patch")).filterString() );
if( !url.isEmpty() ) {
KompareShell* shell = new KompareShell();
shell->show();
......@@ -344,7 +344,7 @@ void KompareShell::slotFileBlendURLAndDiff()
okButton->setToolTip( i18n( "Blend this file or folder with the diff output" ) );
okButton->setWhatsThis( i18n( "If you have entered a file or folder name and a file that contains diff output in the fields in this dialog then this button will be enabled and pressing it will open kompare's main view where the output of the entered file or files from the folder are mixed with the diff output so you can then apply the difference(s) to a file or to the files. " ) );
dialog.setGroup( "Recent Blend Files" );
dialog.setGroup(QStringLiteral("Recent Blend Files"));
dialog.setFirstURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly );
// diff output can not be a directory
......@@ -374,7 +374,7 @@ void KompareShell::slotFileCompareFiles()
okButton->setToolTip( i18n( "Compare these files or folders" ) );
okButton->setWhatsThis( i18n( "If you have entered 2 filenames or 2 folders in the fields in this dialog then this button will be enabled and pressing it will start a comparison of the entered files or folders. " ) );
dialog.setGroup( "Recent Compare Files" );
dialog.setGroup(QStringLiteral("Recent Compare Files"));
dialog.setFirstURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly );
dialog.setSecondURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly );
......@@ -407,16 +407,16 @@ void KompareShell::slotShowTextView()
// FIXME: proper error checking
m_textViewWidget = new QDockWidget( i18n( "Text View" ), this );
m_textViewWidget->setObjectName( "Text View" );
m_textViewWidget->setObjectName(QStringLiteral("Text View"));
// m_textViewWidget = createDockWidget( i18n("Text View"), SmallIcon( "text-x-generic") );
m_textViewPart = KServiceTypeTrader::createInstanceFromQuery<KTextEditor::Document>(
QString::fromLatin1("KTextEditor/Document"),
QStringLiteral("KTextEditor/Document"),
this, this, QString(), QVariantList(), &error );
if ( m_textViewPart )
{
m_textView = qobject_cast<KTextEditor::View*>( m_textViewPart->createView( this ) );
m_textViewWidget->setWidget( static_cast<QWidget*>(m_textView) );
m_textViewPart->setHighlightingMode( "Diff" );
m_textViewPart->setHighlightingMode(QStringLiteral("Diff"));
m_textViewPart->setText( m_diffString );
}
m_textViewWidget->show();
......
......@@ -51,8 +51,8 @@ KompareNavTreePart::KompareNavTreePart( QWidget* parentWidget, QObject* parent,
m_destRootItem(nullptr),
m_selectedModel(nullptr),
m_selectedDifference(nullptr),
m_source( "" ),
m_destination( "" ),
m_source(),
m_destination(),
m_info(nullptr)
{
m_splitter = new QSplitter( Qt::Horizontal, parentWidget );
......@@ -165,10 +165,10 @@ void KompareNavTreePart::buildTreeInMemory()
srcBase = model->sourcePath();
destBase = model->destinationPath();
// FIXME: these tests will not work on windows, we need something else
if ( srcBase[0] != '/' )
srcBase = "";
if ( destBase[0] != '/' )
destBase = "";
if (srcBase[0] != QLatin1Char('/'))
srcBase.clear();
if (destBase[0] != QLatin1Char('/'))
destBase.clear();
break;
case Kompare::ComparingFiles:
srcBase = model->sourcePath();
......@@ -176,11 +176,11 @@ void KompareNavTreePart::buildTreeInMemory()
break;
case Kompare::ComparingDirs:
srcBase = m_info->localSource;
if ( !srcBase.endsWith( '/' ) )
srcBase += '/';
if ( !srcBase.endsWith(QLatin1Char('/')) )
srcBase += QLatin1Char('/');
destBase = m_info->localDestination;
if ( !destBase.endsWith( '/' ) )
destBase += '/';
if ( !destBase.endsWith(QLatin1Char('/')) )
destBase += QLatin1Char('/');
break;
case Kompare::BlendingFile:
case Kompare::BlendingDir:
......@@ -238,7 +238,7 @@ QString KompareNavTreePart::compareFromEndAndReturnSame(
break;
}
if ( srcLen != 0 && destLen != 0 && result.startsWith( '/' ) )
if (srcLen != 0 && destLen != 0 && result.startsWith(QLatin1Char('/')))
result = result.remove( 0, 1 ); // strip leading /, we need it later
return result;
......@@ -477,7 +477,7 @@ void KChangeLVI::setDifferenceText()
break;
default:
qCDebug(KOMPARENAVVIEW) << "Unknown or Unchanged enum value when checking for diff->type() in KChangeLVI's constructor" ;
text = "";
text.clear();
}
setText( 2, text );
......@@ -524,7 +524,7 @@ KFileLVI::KFileLVI( QTreeWidget* parent, DiffModel* model ) : QTreeWidgetItem( p
bool KFileLVI::hasExtension(const QString& extensions, const QString& fileName)
{
QStringList extList = extensions.split(' ');
QStringList extList = extensions.split(QLatin1Char(' '));
foreach (const QString &ext, extList) {
if ( fileName.endsWith(ext, Qt::CaseInsensitive) ) {
return true;
......@@ -536,65 +536,65 @@ bool KFileLVI::hasExtension(const QString& extensions, const QString& fileName)
const QString KFileLVI::getIcon(const QString& fileName)
{
// C++, C
if ( hasExtension( ".h .hpp", fileName ) ) {
return "text-x-c++hdr";
if ( hasExtension(QStringLiteral(".h .hpp"), fileName)) {
return QStringLiteral("text-x-c++hdr");
}
if ( hasExtension( ".cpp", fileName ) ) {
return "text-x-c++src";
if ( hasExtension(QStringLiteral(".cpp"), fileName)) {
return QStringLiteral("text-x-c++src");
}
if ( hasExtension( ".c", fileName ) ) {
return "text-x-csrc";
if ( hasExtension(QStringLiteral(".c"), fileName)) {
return QStringLiteral("text-x-csrc");
}
// Python
if ( hasExtension( ".py .pyw", fileName ) ) {
return "text-x-python";
if ( hasExtension(QStringLiteral(".py .pyw"), fileName)) {
return QStringLiteral("text-x-python");
}
// C#
if ( hasExtension( ".cs", fileName ) ) {
return "text-x-csharp";
if ( hasExtension(QStringLiteral(".cs"), fileName)) {
return QStringLiteral("text-x-csharp");
}
// Objective-C
if ( hasExtension( ".m", fileName ) ) {
return "text-x-objcsrc";
if ( hasExtension(QStringLiteral(".m"), fileName)) {
return QStringLiteral("text-x-objcsrc");
}
// Java
if ( hasExtension( ".java", fileName ) ) {
return "text-x-java";
if ( hasExtension(QStringLiteral(".java"), fileName)) {
return QStringLiteral("text-x-java");
}
// Script
if ( hasExtension( ".sh", fileName ) ) {
return "text-x-script";
if ( hasExtension(QStringLiteral(".sh"), fileName)) {
return QStringLiteral("text-x-script");
}
// Makefile
if ( hasExtension( ".cmake Makefile", fileName ) ) {
return "text-x-makefile";
if ( hasExtension(QStringLiteral(".cmake Makefile"), fileName)) {
return QStringLiteral("text-x-makefile");
}
// Ada
if ( hasExtension( ".ada .ads .adb", fileName ) ) {
return "text-x-adasrc";
if ( hasExtension(QStringLiteral(".ada .ads .adb"), fileName)) {
return QStringLiteral("text-x-adasrc");
}
// Pascal
if ( hasExtension( ".pas", fileName ) ) {
return "text-x-pascal";
if ( hasExtension(QStringLiteral(".pas"), fileName)) {
return QStringLiteral("text-x-pascal");
}
// Patch
if ( hasExtension( ".diff", fileName ) ) {
return "text-x-patch";
if ( hasExtension(QStringLiteral(".diff"), fileName)) {
return QStringLiteral("text-x-patch");
}
// Tcl
if ( hasExtension( ".tcl", fileName ) ) {
return "text-x-tcl";
if ( hasExtension(QStringLiteral(".tcl"), fileName)) {
return QStringLiteral("text-x-tcl");
}
// Text
if ( hasExtension( ".txt", fileName ) ) {
return "text-plain";
if ( hasExtension(QStringLiteral(".txt"), fileName)) {
return QStringLiteral("text-plain");
}
// Xml
if ( hasExtension( ".xml", fileName ) ) {
return "text-xml";
if ( hasExtension(QStringLiteral(".xml"), fileName)) {
return QStringLiteral("text-xml");
}
// unknown or no file extension
return "text-plain";
return QStringLiteral("text-plain");
}
void KFileLVI::fillChangesList( QTreeWidget* changesList, QHash<const Diff2::Difference*, KChangeLVI*>* diffToChangeItemDict )
......@@ -623,7 +623,7 @@ KDirLVI::KDirLVI( QTreeWidget* parent, QString& dir ) : QTreeWidgetItem( parent
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (QTreeWidget) constructor called with dir = " << dir ;
m_rootItem = true;
m_dirName = dir;
setIcon( 0, SmallIcon( "folder" ) );
setIcon(0, SmallIcon(QStringLiteral("folder")));
setExpanded( true );
if ( m_dirName.isEmpty() )
setText( 0, i18n( "Unknown" ) );
......@@ -636,7 +636,7 @@ KDirLVI::KDirLVI( KDirLVI* parent, QString& dir ) : QTreeWidgetItem( parent )
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (KDirLVI) constructor called with dir = " << dir ;
m_rootItem = false;
m_dirName = dir;
setIcon( 0, SmallIcon( "folder" ) );
setIcon( 0, SmallIcon(QStringLiteral("folder")));
setExpanded( true );
setText( 0, m_dirName );
}
......@@ -662,7 +662,7 @@ void KDirLVI::addModel( QString& path, DiffModel* model, QHash<const Diff2::Diff
KDirLVI* child;
QString dir = path.mid( 0, path.indexOf( "/", 0 ) + 1 );
QString dir = path.mid(0, path.indexOf(QLatin1Char('/'), 0) + 1);
child = findChild( dir );
if ( !child )
{
......@@ -766,9 +766,9 @@ KDirLVI::~KDirLVI()
static KAboutData aboutData()
{
KAboutData about("komparenavtreepart", i18n("KompareNavTreePart"), "1.2");
about.addAuthor(i18n("John Firebaugh"), i18n("Author"), "jfirebaugh@kde.org");
about.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), "bruggie@gmail.com" );
KAboutData about(QStringLiteral("komparenavtreepart"), i18n("KompareNavTreePart"), QStringLiteral("1.2"));
about.addAuthor(i18n("John Firebaugh"), i18n("Author"), QStringLiteral("jfirebaugh@kde.org"));
about.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), QStringLiteral("bruggie@gmail.com"));
return about;
}
......
......@@ -68,9 +68,9 @@ static KAboutData createAboutData()
{
KAboutData about(QStringLiteral("komparepart"), i18n("KomparePart"), QStringLiteral("4.0"),
QString(), KAboutLicense::GPL);
about.addAuthor(i18n("John Firebaugh"), i18n("Author"), "jfirebaugh@kde.org");
about.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), "bruggie@gmail.com" );
about.addAuthor(i18n("Kevin Kofler"), i18n("Author"), "kevin.kofler@chello.at" );
about.addAuthor(i18n("John Firebaugh"), i18n("Author"), QStringLiteral("jfirebaugh@kde.org"));
about.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), QStringLiteral("bruggie@gmail.com"));
about.addAuthor(i18n("Kevin Kofler"), i18n("Author"), QStringLiteral("kevin.kofler@chello.at"));
return about;
}
......@@ -183,17 +183,17 @@ void KomparePart::setupActions()
{
// create our actions
m_saveAll = actionCollection()->addAction("file_save_all", this, SLOT(saveAll()));
m_saveAll->setIcon(QIcon::fromTheme("document-save-all"));
m_saveAll = actionCollection()->addAction(QStringLiteral("file_save_all"), this, SLOT(saveAll()));
m_saveAll->setIcon(QIcon::fromTheme(QStringLiteral("document-save-all")));
m_saveAll->setText(i18n("Save &All"));
m_saveDiff = actionCollection()->addAction("file_save_diff", this, SLOT(saveDiff()));
m_saveDiff = actionCollection()->addAction(QStringLiteral("file_save_diff"), this, SLOT(saveDiff()));
m_saveDiff->setText(i18n("Save &Diff..."));
m_swap = actionCollection()->addAction("file_swap", this, SLOT(slotSwap()));
m_swap = actionCollection()->addAction(QStringLiteral("file_swap"), this, SLOT(slotSwap()));
m_swap->setText(i18n("Swap Source with Destination"));
m_diffStats = actionCollection()->addAction("file_diffstats", this, SLOT(slotShowDiffstats()));
m_diffStats = actionCollection()->addAction(QStringLiteral("file_diffstats"), this, SLOT(slotShowDiffstats()));
m_diffStats->setText(i18n("Show Statistics"));
m_diffRefresh = actionCollection()->addAction("file_refreshdiff", this, SLOT(slotRefreshDiff()));
m_diffRefresh->setIcon(QIcon::fromTheme("view-refresh"));
m_diffRefresh = actionCollection()->addAction(QStringLiteral("file_refreshdiff"), this, SLOT(slotRefreshDiff()));
m_diffRefresh->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
m_diffRefresh->setText(i18n("Refresh Diff"));
actionCollection()->setDefaultShortcuts(m_diffRefresh, KStandardShortcut::reload());
......@@ -289,7 +289,7 @@ bool KomparePart::exists( const QString& url )
bool KomparePart::fetchURL( const QUrl& url, bool addToSource )
{
// Default value if there is an error is "", we rely on it!
QString tempFileName( "" );
QString tempFileName;
// Only in case of error do we set result to false, don't forget!!
bool result = true;
QTemporaryDir* tmpDir = nullptr;
......@@ -304,7 +304,7 @@ bool KomparePart::fetchURL( const QUrl& url, bool addToSource )
node = statJob->statResult();
if ( !node.isDir() )
{
tmpDir = new QTemporaryDir(QDir::tempPath() + "/kompare");
tmpDir = new QTemporaryDir(QDir::tempPath() + QLatin1String("/kompare"));
tmpDir->setAutoRemove( true );
tempFileName = tmpDir->path() + QLatin1Char('/') + url.fileName();
KIO::FileCopyJob* copyJob = KIO::file_copy( url, QUrl::fromLocalFile( tempFileName ) );
......@@ -313,13 +313,13 @@ bool KomparePart::fetchURL( const QUrl& url, bool addToSource )
{
qDebug() << "download error " << copyJob->errorString();
slotShowError( i18n( "<qt>The URL <b>%1</b> cannot be downloaded.</qt>", url.toDisplayString() ) );
tempFileName = ""; // Not sure if download has already touched this tempFileName when there is an error
tempFileName.clear(); // Not sure if download has already touched this tempFileName when there is an error
result = false;
}
}
else
{
tmpDir = new QTemporaryDir(QDir::tempPath() + "/kompare");
tmpDir = new QTemporaryDir(QDir::tempPath() + QLatin1String("/kompare"));
tmpDir->setAutoRemove( true ); // Yes this is the default but just to make sure
KIO::CopyJob *copyJob = KIO::copy( url, QUrl::fromLocalFile( tmpDir->path() ));
KJobWidgets::setWindow( copyJob, widget() );
......@@ -340,17 +340,17 @@ bool KomparePart::fetchURL( const QUrl& url, bool addToSource )
QStringList entries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot );
if ( entries.size() == 1 ) // More than 1 entry in here means big problems!!!
{
if ( !tempFileName.endsWith( '/' ) )
tempFileName += '/';
if (!tempFileName.endsWith(QLatin1Char('/')))
tempFileName += QLatin1Char('/');
tempFileName += entries.at( 0 );
tempFileName += '/';
tempFileName += QLatin1Char('/');
}
else
{
qCDebug(KOMPAREPART) << "Yikes, nothing downloaded?";
delete tmpDir;
tmpDir = nullptr;
tempFileName = "";
tempFileName.clear();
result = false;
}
}
......@@ -393,7 +393,7 @@ void KomparePart::cleanUpTemporaryFiles()
delete m_info.sourceQTempDir;
m_info.sourceQTempDir = nullptr;
}
m_info.localSource = "";
m_info.localSource.clear();
}
if ( !m_info.localDestination.isEmpty() )
{
......@@ -402,7 +402,7 @@ void KomparePart::cleanUpTemporaryFiles()
delete m_info.destinationQTempDir;
m_info.destinationQTempDir = nullptr;
}
m_info.localDestination = "";
m_info.localDestination.clear();
}
}
......@@ -550,7 +550,7 @@ bool KomparePart::saveAll()
void KomparePart::saveDiff()
{
QDialog dlg( widget() );
dlg.setObjectName( "save_options" );
dlg.setObjectName(QStringLiteral("save_options"));
dlg.setModal( true );
dlg.setWindowTitle( i18n("Diff Options") );
QDialogButtonBox *buttons = new QDialogButtonBox( QDialogButtonBox::Save | QDialogButtonBox::Cancel, &dlg );
......@@ -692,7 +692,7 @@ void KomparePart::updateCaption()
case Kompare::ComparingDirs :
case Kompare::BlendingFile :
case Kompare::BlendingDir :
text = source + " -- " + destination; // no need to translate this " -- "
text = source + QLatin1String(" -- ") + destination; // no need to translate this " -- "
break;
case Kompare::ShowingDiff :
text = source;
......@@ -847,8 +847,8 @@ void KomparePart::slotShowDiffstats( void )
int noOfHunks;
int noOfDiffs;
oldFile = m_modelList->selectedModel() ? m_modelList->selectedModel()->sourceFile() : QString( "" );
newFile = m_modelList->selectedModel() ? m_modelList->selectedModel()->destinationFile() : QString( "" );
oldFile = m_modelList->selectedModel() ? m_modelList->selectedModel()->sourceFile() : QString();
newFile = m_modelList->selectedModel() ? m_modelList->selectedModel()->destinationFile() : QString();
if ( m_modelList->selectedModel() )
{
......@@ -876,7 +876,7 @@ void KomparePart::slotShowDiffstats( void )
}
else
{
diffFormat = "";
diffFormat.clear();
}
filesInDiff = m_modelList->modelCount();
......
......@@ -40,10 +40,10 @@ KompareConnectWidgetFrame::KompareConnectWidgetFrame( ViewSettings* settings,
const char* name ) :
QSplitterHandle(Qt::Horizontal, (QSplitter *)parent),
m_wid ( settings, this, name ),
m_label ( " ", this ), // putting a space here because Qt 4 computes different size hints for empty labels
m_label(QStringLiteral(" "), this), // putting a space here because Qt 4 computes different size hints for empty labels
m_layout ( this )
{
setObjectName( name );
setObjectName(QLatin1String(name));
setSizePolicy ( QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored) );
m_wid.setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored) );
m_label.setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) );
......@@ -107,7 +107,7 @@ KompareConnectWidget::KompareConnectWidget( ViewSettings* settings, QWidget* par
m_selectedModel(nullptr),
m_selectedDifference(nullptr)
{
setObjectName(name);
setObjectName(QLatin1String(name));
// connect( m_settings, SIGNAL( settingsChanged() ), this, SLOT( slotDelayedRepaint() ) );
setAttribute( Qt::WA_NoSystemBackground, true );
setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ) );
......
......@@ -57,7 +57,7 @@ KompareListViewFrame::KompareListViewFrame( bool isSource,
const char* name ):
QFrame ( parent ),
m_view ( isSource, settings, this, name ),
m_label ( isSource?"Source":"Dest", this ),
m_label ( isSource?QStringLiteral("Source"):QStringLiteral("Dest"), this ),
m_layout ( this )
{
setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored) );
......@@ -88,12 +88,12 @@ void KompareListViewFrame::slotSetModel( const DiffModel* model )
{
if( view()->isSource() ) {
if( !model->sourceRevision().isEmpty() )
m_label.setText( model->sourceFile() + " (" + model->sourceRevision() + ')' );
m_label.setText( model->sourceFile() + QLatin1String(" (") + model->sourceRevision() + QLatin1Char(')'));
else
m_label.setText( model->sourceFile() );
} else {
if( !model->destinationRevision().isEmpty() )
m_label.setText( model->destinationFile() + " (" + model->destinationRevision() + ')' );
m_label.setText( model->destinationFile() + QLatin1String(" (") + model->destinationRevision() + QLatin1Char(')'));
else
m_label.setText( model->destinationFile() );
}
......@@ -112,7 +112,7 @@ KompareListView::KompareListView( bool isSource,
m_selectedModel(nullptr),
m_selectedDifference(nullptr)
{
setObjectName( name );
setObjectName(QLatin1String(name));
setItemDelegate( new KompareListViewItemDelegate( this ) );
setHeaderHidden( true );
setColumnCount( 3 ); // Line Number, Main, Blank
......@@ -896,7 +896,7 @@ void KompareListViewLineItem::expandTabs(QString& text, int tabstop, int startPo
{
int index;
while((index = text.indexOf(QChar(9)))!= -1)
text.replace(index, 1, QString(tabstop-((startPos+index)%tabstop),' '));
text.replace(index, 1, QString(tabstop-((startPos+index)%tabstop), QLatin1Char(' ')));
}
KompareListViewDiffItem* KompareListViewLineItem::diffItemParent() const
......
......@@ -44,13 +44,13 @@ KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets )
m_viewPage = new ViewPage();
KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) );
item->setIcon( QIcon::fromTheme( "preferences-desktop-theme" ) );
item->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-theme")));
item->setHeader( i18n( "View Settings" ) );
m_viewPage->setSettings( viewSets );
m_diffPage = new DiffPage();
item = addPage( m_diffPage, i18n( "Diff" ) );
item->setIcon( QIcon::fromTheme( "text-x-patch" ) );
item->setIcon(QIcon::fromTheme(QStringLiteral("text-x-patch")));
item->setHeader( i18n( "Diff Settings" ) );
m_diffPage->setSettings( diffSets );
......@@ -90,13 +90,13 @@ void KomparePrefDlg::slotHelp()
switch ( currentTab )
{
case 0:
KHelpClient::invokeHelp( "appearance" );
KHelpClient::invokeHelp(QStringLiteral("appearance"));
break;
case 1:
KHelpClient::invokeHelp( "fonts" );
KHelpClient::invokeHelp(QStringLiteral("fonts"));
break;
default:
KHelpClient::invokeHelp( "view-settings" );
KHelpClient::invokeHelp(QStringLiteral("view-settings"));
}
}
else if ( dynamic_cast<DiffPage*>(currentpage) )
......@@ -106,23 +106,23 @@ void KomparePrefDlg::slotHelp()
switch ( currentTab )
{
case 0:
KHelpClient::invokeHelp( "diff" );
KHelpClient::invokeHelp(QStringLiteral("diff"));
break;
case 1:
KHelpClient::invokeHelp( "diff-format" );
KHelpClient::invokeHelp(QStringLiteral("diff-format"));
break;
case 2:
KHelpClient::invokeHelp( "options" );
KHelpClient::invokeHelp(QStringLiteral("options"));
break;
case 3:
KHelpClient::invokeHelp( "exclude" );
KHelpClient::invokeHelp(QStringLiteral("exclude"));
break;
default:
KHelpClient::invokeHelp( "diff-settings" );
KHelpClient::invokeHelp(QStringLiteral("diff-settings"));
}
}
else // Fallback since we had not added the code for the page/tab or forgotten about it
KHelpClient::invokeHelp( "configure-preferences" );
KHelpClient::invokeHelp(QStringLiteral("configure-preferences"));
}
/** No descriptions */
......
......@@ -35,7 +35,7 @@ KompareSaveOptionsWidget::KompareSaveOptionsWidget( QString source, QString dest
, m_destination( destination )
, m_FormatBG( new QButtonGroup(this) )
{
setObjectName("save options");