Commit a1ddf29d authored by Christoph Pfister's avatar Christoph Pfister

enforce -DQT_NO_CAST_FROM_ASCII

parent d3dea83d
......@@ -19,8 +19,8 @@ if(STRICT_BUILD)
-isystem /usr/include/qt4/QtCore
-isystem /usr/include/qt4/QtGui
-isystem /usr/include/qt4/QtNetwork
-DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING
-DQT_STRICT_ITERATORS)
-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII
-DQT_NO_URL_CAST_FROM_STRING -DQT_STRICT_ITERATORS)
endif(STRICT_BUILD)
check_include_files(${CMAKE_CURRENT_SOURCE_DIR}/include/frontend.h HAVE_DVB)
......
if(STRICT_BUILD)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
endif(STRICT_BUILD)
set(dtvdaemon_SRCS
connection.cpp
dtvdaemon.cpp
......
......@@ -35,14 +35,14 @@ bool VlcMediaWidget::init()
vlcInstance = libvlc_new(sizeof(arguments) / sizeof(arguments[0]), arguments);
if (vlcInstance == NULL) {
Log("VlcMediaWidget::init: cannot create vlc instance") << libvlc_errmsg();
Log("VlcMediaWidget::init: cannot create vlc instance") << QLatin1String(libvlc_errmsg());
return false;
}
vlcMediaPlayer = libvlc_media_player_new(vlcInstance);
if (vlcMediaPlayer == NULL) {
Log("VlcMediaWidget::init: cannot create vlc media player") << libvlc_errmsg();
Log("VlcMediaWidget::init: cannot create vlc media player") << QLatin1String(libvlc_errmsg());
return false;
}
......@@ -383,10 +383,10 @@ void VlcMediaWidget::updateAudioStreams()
while (track != NULL) {
QString audioStream = QString::fromUtf8(track->psz_name);
int cutBegin = (audioStream.indexOf('[') + 1);
int cutBegin = (audioStream.indexOf(QLatin1Char('[')) + 1);
if (cutBegin > 0) {
int cutEnd = audioStream.lastIndexOf(']');
int cutEnd = audioStream.lastIndexOf(QLatin1Char(']'));
if (cutEnd >= 0) {
// remove unnecessary text
......@@ -418,10 +418,10 @@ void VlcMediaWidget::updateSubtitles()
while (track != NULL) {
QString subtitle = QString::fromUtf8(track->psz_name);
int cutBegin = (subtitle.indexOf('[') + 1);
int cutBegin = (subtitle.indexOf(QLatin1Char('[')) + 1);
if (cutBegin > 0) {
int cutEnd = subtitle.lastIndexOf(']');
int cutEnd = subtitle.lastIndexOf(QLatin1Char(']'));
if (cutEnd >= 0) {
// remove unnecessary text
......
......@@ -75,7 +75,7 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent) : KPageDialog(parent)
gridLayout->setRowStretch(3, 1);
KPageWidgetItem *page = new KPageWidgetItem(widget, i18nc("@title:group", "General"));
page->setIcon(KIcon("configure"));
page->setIcon(KIcon(QLatin1String("configure")));
addPage(page);
widget = new QWidget(this);
......@@ -96,7 +96,7 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent) : KPageDialog(parent)
gridLayout->setRowStretch(2, 1);
page = new KPageWidgetItem(widget, i18nc("@title:group", "Diagnostics"));
page->setIcon(KIcon("page-zoom"));
page->setIcon(KIcon(QLatin1String("page-zoom")));
addPage(page);
}
......@@ -129,7 +129,7 @@ DmesgDialog::DmesgDialog(QWidget *parent) : KDialog(parent)
dmesgProcess = new QProcess(this);
dmesgProcess->setProcessChannelMode(QProcess::MergedChannels);
connect(dmesgProcess, SIGNAL(readyRead()), this, SLOT(readyRead()));
dmesgProcess->start("dmesg", QIODevice::ReadOnly);
dmesgProcess->start(QLatin1String("dmesg"), QIODevice::ReadOnly);
dmesgTextEdit = new QPlainTextEdit(this);
dmesgTextEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
......@@ -145,5 +145,5 @@ DmesgDialog::~DmesgDialog()
void DmesgDialog::readyRead()
{
dmesgTextEdit->setPlainText(dmesgTextEdit->toPlainText() + dmesgProcess->readAll());
dmesgTextEdit->setPlainText(dmesgTextEdit->toPlainText() + QString::fromLocal8Bit(dmesgProcess->readAll().constData()));
}
......@@ -28,40 +28,40 @@ static QString localQtDateFormat()
QString dateFormat = KGlobal::locale()->dateFormatShort();
for (int i = 0; (i + 1) < dateFormat.size(); ++i) {
if (dateFormat.at(i) != '%') {
if (dateFormat.at(i) != QLatin1Char('%')) {
continue;
}
switch (dateFormat.at(i + 1).unicode()) {
case 'Y':
dateFormat.replace(i, 2, "yyyy");
dateFormat.replace(i, 2, QLatin1String("yyyy"));
break;
case 'y':
dateFormat.replace(i, 2, "yy");
dateFormat.replace(i, 2, QLatin1String("yy"));
break;
case 'n':
dateFormat.replace(i, 2, 'M');
dateFormat.replace(i, 2, QLatin1Char('M'));
break;
case 'm':
dateFormat.replace(i, 2, "MM");
dateFormat.replace(i, 2, QLatin1String("MM"));
break;
case 'e':
dateFormat.replace(i, 2, 'd');
dateFormat.replace(i, 2, QLatin1Char('d'));
break;
case 'd':
dateFormat.replace(i, 2, "dd");
dateFormat.replace(i, 2, QLatin1String("dd"));
break;
case 'b':
dateFormat.replace(i, 2, "MMM");
dateFormat.replace(i, 2, QLatin1String("MMM"));
break;
case 'B':
dateFormat.replace(i, 2, "MMMM");
dateFormat.replace(i, 2, QLatin1String("MMMM"));
break;
case 'a':
dateFormat.replace(i, 2, "ddd");
dateFormat.replace(i, 2, QLatin1String("ddd"));
break;
case 'A':
dateFormat.replace(i, 2, "dddd");
dateFormat.replace(i, 2, QLatin1String("dddd"));
break;
}
}
......@@ -74,7 +74,7 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
QString timeFormat = KGlobal::locale()->timeFormat();
for (int i = 0; (i + 1) < timeFormat.size(); ++i) {
if (timeFormat.at(i) != '%') {
if (timeFormat.at(i) != QLatin1Char('%')) {
continue;
}
......@@ -83,18 +83,18 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
switch (timeFormat.at(i + 1).unicode()) {
case 'H':
case 'I':
timeFormat.replace(i, 2, "hh");
timeFormat.replace(i, 2, QLatin1String("hh"));
break;
case 'k':
case 'l':
timeFormat.replace(i, 2, 'h');
timeFormat.replace(i, 2, QLatin1Char('h'));
break;
case 'M':
timeFormat.replace(i, 2, "mm");
timeFormat.replace(i, 2, QLatin1String("mm"));
break;
case 'S':
if (showSeconds) {
timeFormat.replace(i, 2, "ss");
timeFormat.replace(i, 2, QLatin1String("ss"));
} else {
strip = true;
}
......@@ -102,7 +102,7 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
break;
case 'p':
if (!duration) {
timeFormat.replace(i, 2, "AP");
timeFormat.replace(i, 2, QLatin1String("AP"));
} else {
strip = true;
}
......@@ -119,7 +119,7 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
}
if ((beginRemove > 0) && timeFormat.at(beginRemove - 1).isPunct() &&
(timeFormat.at(beginRemove - 1) != '%')) {
(timeFormat.at(beginRemove - 1) != QLatin1Char('%'))) {
--beginRemove;
while ((beginRemove > 0) &&
......@@ -136,7 +136,7 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
if ((endRemove < timeFormat.size()) &&
timeFormat.at(endRemove).isPunct() &&
(timeFormat.at(endRemove) != '%')) {
(timeFormat.at(endRemove) != QLatin1Char('%'))) {
++endRemove;
while ((endRemove < timeFormat.size()) &&
......@@ -156,7 +156,7 @@ static QString localQtTimeFormat(bool showSeconds, bool duration)
DateTimeEdit::DateTimeEdit(QWidget *parent) : QDateTimeEdit(parent)
{
setDisplayFormat(localQtDateFormat() + ' ' + localQtTimeFormat(false, false));
setDisplayFormat(localQtDateFormat() + QLatin1Char(' ') + localQtTimeFormat(false, false));
}
DateTimeEdit::~DateTimeEdit()
......
......@@ -92,7 +92,7 @@ MprisRootObject::~MprisRootObject()
QString MprisRootObject::Identity()
{
const KAboutData *aboutData = KGlobal::mainComponent().aboutData();
return aboutData->programName() + ' ' + aboutData->version();
return aboutData->programName() + QLatin1Char(' ' )+ aboutData->version();
}
void MprisRootObject::Quit()
......@@ -365,7 +365,7 @@ QList<TelevisionScheduleEntryStruct> DBusTelevisionObject::ListProgramSchedule()
entry.key = recording->sqlKey;
entry.name = recording->name;
entry.channel = recording->channel->name;
entry.begin = (recording->begin.toString(Qt::ISODate) + 'Z');
entry.begin = (recording->begin.toString(Qt::ISODate) + QLatin1Char('Z'));
entry.duration = recording->duration.toString(Qt::ISODate);
entry.repeat = recording->repeat;
entry.isRunning = (recording->status != DvbRecording::Inactive);
......
......@@ -119,13 +119,13 @@ DvbChannelModel *DvbChannelModel::createSqlModel(QObject *parent)
{
DvbChannelModel *channelModel = new DvbChannelModel(parent);
channelModel->isSqlModel = true;
channelModel->sqlInit("Channels",
QStringList() << "Name" << "Number" << "Source" << "Transponder" << "NetworkId" <<
"TransportStreamId" << "PmtPid" << "PmtSection" << "AudioPid" << "Flags");
channelModel->sqlInit(QLatin1String("Channels"),
QStringList() << QLatin1String("Name") << QLatin1String("Number") << QLatin1String("Source") << QLatin1String("Transponder") << QLatin1String("NetworkId") <<
QLatin1String("TransportStreamId") << QLatin1String("PmtPid") << QLatin1String("PmtSection") << QLatin1String("AudioPid") << QLatin1String("Flags"));
// compatibility code
QFile file(KStandardDirs::locateLocal("appdata", "channels.dtv"));
QFile file(KStandardDirs::locateLocal("appdata", QLatin1String("channels.dtv")));
if (!file.exists()) {
return channelModel;
......@@ -589,7 +589,7 @@ bool DvbChannelModel::insertFromSqlQuery(SqlKey sqlKey, const QSqlQuery &query,
QString DvbChannelModel::extractBaseName(const QString &name) const
{
QString baseName = name;
int position = baseName.lastIndexOf('-');
int position = baseName.lastIndexOf(QLatin1Char('-'));
if (position > 0) {
QString suffix = baseName.mid(position + 1);
......@@ -614,7 +614,7 @@ QString DvbChannelModel::findNextFreeChannelName(const QString &name) const
while (channelNames.contains(newName)) {
++suffix;
newName = baseName + '-' + QString::number(suffix);
newName = baseName + QLatin1Char('-') + QString::number(suffix);
}
return newName;
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ DvbConfigDialog::DvbConfigDialog(DvbManager *manager_, QWidget *parent) : KDialo
gridLayout->addWidget(recordingFolderEdit, 0, 1);
QToolButton *toolButton = new QToolButton(widget);
toolButton->setIcon(KIcon("document-open-folder"));
toolButton->setIcon(KIcon(QLatin1String("document-open-folder")));
toolButton->setToolTip(i18n("Select Folder"));
connect(toolButton, SIGNAL(clicked()), this, SLOT(changeRecordingFolder()));
gridLayout->addWidget(toolButton, 0, 2);
......@@ -71,7 +71,7 @@ DvbConfigDialog::DvbConfigDialog(DvbManager *manager_, QWidget *parent) : KDialo
gridLayout->addWidget(timeShiftFolderEdit, 1, 1);
toolButton = new QToolButton(widget);
toolButton->setIcon(KIcon("document-open-folder"));
toolButton->setIcon(KIcon(QLatin1String("document-open-folder")));
toolButton->setToolTip(i18n("Select Folder"));
connect(toolButton, SIGNAL(clicked()), this, SLOT(changeTimeShiftFolder()));
gridLayout->addWidget(toolButton, 1, 2);
......@@ -128,8 +128,8 @@ DvbConfigDialog::DvbConfigDialog(DvbManager *manager_, QWidget *parent) : KDialo
connect(latitudeEdit, SIGNAL(textChanged(QString)), this, SLOT(latitudeChanged(QString)));
gridLayout->addWidget(latitudeEdit, 0, 2);
validPixmap = KIcon("dialog-ok-apply").pixmap(KIconLoader::SizeSmallMedium);
invalidPixmap = KIcon("dialog-cancel").pixmap(KIconLoader::SizeSmallMedium);
validPixmap = KIcon(QLatin1String("dialog-ok-apply")).pixmap(KIconLoader::SizeSmallMedium);
invalidPixmap = KIcon(QLatin1String("dialog-cancel")).pixmap(KIconLoader::SizeSmallMedium);
latitudeValidLabel = new QLabel(widget);
latitudeValidLabel->setPixmap(validPixmap);
......@@ -153,7 +153,7 @@ DvbConfigDialog::DvbConfigDialog(DvbManager *manager_, QWidget *parent) : KDialo
// FIXME more general options
tabWidget->addTab(widget, KIcon("configure"), i18n("General Options"));
tabWidget->addTab(widget, KIcon(QLatin1String("configure")), i18n("General Options"));
int i = 1;
......@@ -165,7 +165,7 @@ DvbConfigDialog::DvbConfigDialog(DvbManager *manager_, QWidget *parent) : KDialo
this, SLOT(moveRight(DvbConfigPage*)));
connect(configPage, SIGNAL(remove(DvbConfigPage*)),
this, SLOT(remove(DvbConfigPage*)));
tabWidget->addTab(configPage, KIcon("video-television"), i18n("Device %1", i));
tabWidget->addTab(configPage, KIcon(QLatin1String("video-television")), i18n("Device %1", i));
configPages.append(configPage);
++i;
}
......@@ -255,7 +255,7 @@ void DvbConfigDialog::moveLeft(DvbConfigPage *configPage)
}
// configPages and tabWidget indexes differ by one
tabWidget->insertTab(index, configPages.at(index - 1), KIcon("video-television"),
tabWidget->insertTab(index, configPages.at(index - 1), KIcon(QLatin1String("video-television")),
i18n("Device %1", index));
tabWidget->setTabText(index + 1, i18n("Device %1", index + 1));
tabWidget->setCurrentIndex(index);
......@@ -282,7 +282,7 @@ void DvbConfigDialog::moveRight(DvbConfigPage *configPage)
}
// configPages and tabWidget indexes differ by one
tabWidget->insertTab(index, configPages.at(index - 1), KIcon("video-television"),
tabWidget->insertTab(index, configPages.at(index - 1), KIcon(QLatin1String("video-television")),
i18n("Device %1", index));
tabWidget->setTabText(index + 1, i18n("Device %1", index + 1));
tabWidget->setCurrentIndex(index + 1);
......@@ -453,22 +453,22 @@ DvbConfigPage::DvbConfigPage(QWidget *parent, DvbManager *manager,
boxLayout->addWidget(new QLabel(i18n("Name: %1", deviceConfig->frontendName)));
QBoxLayout *horizontalLayout = new QHBoxLayout();
moveLeftButton = new QPushButton(KIcon("arrow-left"), i18n("Move Left"), this);
moveLeftButton = new QPushButton(KIcon(QLatin1String("arrow-left")), i18n("Move Left"), this);
connect(moveLeftButton, SIGNAL(clicked()), this, SLOT(moveLeft()));
horizontalLayout->addWidget(moveLeftButton);
if (deviceConfig->device != NULL) {
QPushButton *pushButton = new QPushButton(KIcon("edit-undo"), i18n("Reset"), this);
QPushButton *pushButton = new QPushButton(KIcon(QLatin1String("edit-undo")), i18n("Reset"), this);
connect(pushButton, SIGNAL(clicked()), this, SIGNAL(resetConfig()));
horizontalLayout->addWidget(pushButton);
} else {
QPushButton *pushButton =
new QPushButton(KIcon("edit-delete"), i18nc("@action", "Remove"), this);
new QPushButton(KIcon(QLatin1String("edit-delete")), i18nc("@action", "Remove"), this);
connect(pushButton, SIGNAL(clicked()), this, SLOT(removeConfig()));
horizontalLayout->addWidget(pushButton);
}
moveRightButton = new QPushButton(KIcon("arrow-right"), i18n("Move Right"), this);
moveRightButton = new QPushButton(KIcon(QLatin1String("arrow-right")), i18n("Move Right"), this);
connect(moveRightButton, SIGNAL(clicked()), this, SLOT(moveRight()));
horizontalLayout->addWidget(moveRightButton);
boxLayout->addLayout(horizontalLayout);
......@@ -636,11 +636,11 @@ DvbConfigObject::DvbConfigObject(QWidget *parent, QBoxLayout *layout, DvbManager
break;
case DvbConfigBase::DvbT:
defaultName = i18n("Terrestrial");
sources.append("AUTO-Normal");
sources.append("AUTO-Offsets");
sources.append("AUTO-Australia");
sources.append("AUTO-Italy");
sources.append("AUTO-Taiwan");
sources.append(QLatin1String("AUTO-Normal"));
sources.append(QLatin1String("AUTO-Offsets"));
sources.append(QLatin1String("AUTO-Australia"));
sources.append(QLatin1String("AUTO-Italy"));
sources.append(QLatin1String("AUTO-Taiwan"));
sources += manager->getScanSources(DvbManager::DvbT);
sourceIndex = sources.indexOf(config->scanSource);
sources.replace(0, i18n("Autoscan"));
......@@ -710,19 +710,19 @@ void DvbConfigObject::sourceChanged(int index)
switch (index - 1) {
case 0:
config->scanSource = "AUTO-Normal";
config->scanSource = QLatin1String("AUTO-Normal");
break;
case 1:
config->scanSource = "AUTO-Offsets";
config->scanSource = QLatin1String("AUTO-Offsets");
break;
case 2:
config->scanSource = "AUTO-Australia";
config->scanSource = QLatin1String("AUTO-Australia");
break;
case 3:
config->scanSource = "AUTO-Italy";
config->scanSource = QLatin1String("AUTO-Italy");
break;
case 4:
config->scanSource = "AUTO-Taiwan";
config->scanSource = QLatin1String("AUTO-Taiwan");
break;
}
} else {
......
......@@ -220,8 +220,8 @@ public:
DvbDataDumper::DvbDataDumper()
{
setFileName(QDir::homePath() + '/' + "KaffeineDvbDump-" + QString::number(qrand(), 16) +
".bin");
setFileName(QDir::homePath() + QLatin1String("/KaffeineDvbDump-") + QString::number(qrand(), 16) +
QLatin1String(".bin"));
if (!open(QIODevice::WriteOnly | QIODevice::Truncate)) {
Log("DvbDataDumper::DvbDataDumper: cannot open") << fileName();
......@@ -365,15 +365,15 @@ void DvbDevice::tune(const DvbTransponder &transponder)
case DvbConfigBase::UsalsRotor: {
QString source = config->scanSource;
source.remove(0, source.lastIndexOf('-') + 1);
source.remove(0, source.lastIndexOf(QLatin1Char('-')) + 1);
bool ok = false;
double orbitalPosition = 0;
if (source.endsWith('E')) {
if (source.endsWith(QLatin1Char('E'))) {
source.chop(1);
orbitalPosition = source.toDouble(&ok);
} else if (source.endsWith('W')) {
} else if (source.endsWith(QLatin1Char('W'))) {
source.chop(1);
orbitalPosition = (-source.toDouble(&ok));
}
......
......@@ -100,7 +100,7 @@ void DvbLinuxDevice::startDevice(const QString &deviceId_)
break;
default:
Log("DvbLinuxDevice::startDevice: unknown type") << frontend_info.type <<
"for frontend" << frontendPath;
QLatin1String("for frontend") << frontendPath;
return;
}
......@@ -907,33 +907,33 @@ void DvbLinuxDeviceManager::componentAdded(const QString &udi)
if (addDevice && !device->demuxPath.isEmpty() && !device->dvrPath.isEmpty() &&
!device->frontendPath.isEmpty()) {
QString path = QString("/sys/class/dvb/dvb%1.frontend%2/").arg(adapter).arg(index);
QString path = QString(QLatin1String("/sys/class/dvb/dvb%1.frontend%2/")).arg(adapter).arg(index);
QString deviceId;
if (QFile::exists(path + "device/vendor")) {
if (QFile::exists(path + QLatin1String("device/vendor"))) {
// PCI device
int vendor = readSysAttr(path + "device/vendor");
int pciDevice = readSysAttr(path + "device/device");
int subsystem_vendor = readSysAttr(path + "device/subsystem_vendor");
int subsystem_device = readSysAttr(path + "device/subsystem_device");
int vendor = readSysAttr(path + QLatin1String("device/vendor"));
int pciDevice = readSysAttr(path + QLatin1String("device/device"));
int subsystem_vendor = readSysAttr(path + QLatin1String("device/subsystem_vendor"));
int subsystem_device = readSysAttr(path + QLatin1String("device/subsystem_device"));
if ((vendor >= 0) && (pciDevice >= 0) && (subsystem_vendor >= 0) &&
(subsystem_device >= 0)) {
deviceId = 'P';
deviceId += QString("%1").arg(vendor, 4, 16, QChar('0'));
deviceId += QString("%1").arg(pciDevice, 4, 16, QChar('0'));
deviceId += QString("%1").arg(subsystem_vendor, 4, 16, QChar('0'));
deviceId += QString("%1").arg(subsystem_device, 4, 16, QChar('0'));
deviceId = QLatin1Char('P');
deviceId += QString(QLatin1String("%1")).arg(vendor, 4, 16, QLatin1Char('0'));
deviceId += QString(QLatin1String("%1")).arg(pciDevice, 4, 16, QLatin1Char('0'));
deviceId += QString(QLatin1String("%1")).arg(subsystem_vendor, 4, 16, QLatin1Char('0'));
deviceId += QString(QLatin1String("%1")).arg(subsystem_device, 4, 16, QLatin1Char('0'));
}
} else if (QFile::exists(path + "device/idVendor")) {
} else if (QFile::exists(path + QLatin1String("device/idVendor"))) {
// USB device
int vendor = readSysAttr(path + "device/idVendor");
int product = readSysAttr(path + "device/idProduct");
int vendor = readSysAttr(path + QLatin1String("device/idVendor"));
int product = readSysAttr(path + QLatin1String("device/idProduct"));
if ((vendor >= 0) && (product >= 0)) {
deviceId = 'U';
deviceId += QString("%1").arg(vendor, 4, 16, QChar('0'));
deviceId += QString("%1").arg(product, 4, 16, QChar('0'));
deviceId = QLatin1Char('U');
deviceId += QString(QLatin1String("%1")).arg(vendor, 4, 16, QLatin1Char('0'));
deviceId += QString(QLatin1String("%1")).arg(product, 4, 16, QLatin1Char('0'));
}
}
......
......@@ -86,7 +86,7 @@ DvbEpgModel::DvbEpgModel(DvbManager *manager_, QObject *parent) : QObject(parent
// TODO use SQL to store epg data
QFile file(KStandardDirs::locateLocal("appdata", "epgdata.dvb"));
QFile file(KStandardDirs::locateLocal("appdata", QLatin1String("epgdata.dvb")));
if (!file.open(QIODevice::ReadOnly)) {
Log("DvbEpgModel::DvbEpgModel: cannot open") << file.fileName();
......@@ -147,7 +147,7 @@ DvbEpgModel::~DvbEpgModel()
Log("DvbEpgModel::~DvbEpgModel: filter list not empty");
}
QFile file(KStandardDirs::locateLocal("appdata", "epgdata.dvb"));
QFile file(KStandardDirs::locateLocal("appdata", QLatin1String("epgdata.dvb")));
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
Log("DvbEpgModel::~DvbEpgModel: cannot open") << file.fileName();
......
......@@ -56,7 +56,7 @@ DvbEpgDialog::DvbEpgDialog(DvbManager *manager_, QWidget *parent) : KDialog(pare
QBoxLayout *rightLayout = new QVBoxLayout();
QBoxLayout *boxLayout = new QHBoxLayout();
KAction *scheduleAction = new KAction(KIcon("media-record"),
KAction *scheduleAction = new KAction(KIcon(QLatin1String("media-record")),
i18nc("@action:inmenu tv show", "Record Show"), this);
connect(scheduleAction, SIGNAL(triggered()), this, SLOT(scheduleProgram()));
......@@ -326,7 +326,7 @@ QVariant DvbEpgTableModel::data(const QModelIndex &index, int role) const
switch (role) {
case Qt::DecorationRole:
if ((index.column() == 2) && entry->recording.isValid()) {
return KIcon("media-record");
return KIcon(QLatin1String("media-record"));
}
break;
......
......@@ -64,15 +64,15 @@ QPixmap DvbOsd::paintOsd(QRect &rect, const QFont &font, Qt::LayoutDirection)
if (firstEntry.channel.isValid()) {
entryString = KGlobal::locale()->formatTime(firstEntry.begin.toLocalTime().time())
+ ' ' + firstEntry.title;
+ QLatin1Char(' ') + firstEntry.title;
elapsedTime = firstEntry.begin.secsTo(QDateTime::currentDateTime());
totalTime = QTime().secsTo(firstEntry.duration);
}
if ((level == ShortOsd) && secondEntry.channel.isValid()) {
entryString = entryString + '\n' +
entryString = entryString + QLatin1Char('\n') +
KGlobal::locale()->formatTime(secondEntry.begin.toLocalTime().time()) +
' ' + secondEntry.title;
QLatin1Char(' ') + secondEntry.title;
}
int lineHeight = QFontMetrics(osdFont).height();
......@@ -245,7 +245,7 @@ void DvbLiveView::toggleOsd()
switch (internal->dvbOsd.level) {
case DvbOsd::Off:
internal->dvbOsd.init(DvbOsd::ShortOsd,
QString("%1 - %2").arg(channel->number).arg(channel->name),
QString(QLatin1String("%1 - %2")).arg(channel->number).arg(channel->name),
manager->getEpgModel()->getCurrentNext(channel));
osdWidget->showObject(&internal->dvbOsd, 2500);
osdTimer.start(2500);
......@@ -432,15 +432,15 @@ void DvbLiveView::playbackStatusChanged(MediaWidget::PlaybackStatus playbackStat
break;
}
internal->timeShiftFile.setFileName(manager->getTimeShiftFolder() + "/TimeShift-" +
QDateTime::currentDateTime().toString("yyyyMMddThhmmss") + ".m2t");
internal->timeShiftFile.setFileName(manager->getTimeShiftFolder() + QLatin1String("/TimeShift-") +
QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddThhmmss")) + QLatin1String(".m2t"));
if (internal->timeShiftFile.exists() ||
!internal->timeShiftFile.open(QIODevice::WriteOnly)) {
Log("DvbLiveView::playbackStatusChanged: cannot open file") <<
internal->timeShiftFile.fileName();
internal->timeShiftFile.setFileName(QDir::homePath() + "/TimeShift-" +
QDateTime::currentDateTime().toString("yyyyMMddThhmmss") + ".m2t");
internal->timeShiftFile.setFileName(QDir::homePath() + QLatin1String("/TimeShift-") +
QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddThhmmss")) + QLatin1String(".m2t"));
if (internal->timeShiftFile.exists() ||
!internal->timeShiftFile.open(QIODevice::WriteOnly)) {
......@@ -571,7 +571,7 @@ void DvbLiveView::updatePids(bool forcePatPmtUpdate)
DvbLiveViewInternal::DvbLiveViewInternal(QObject *parent) : QObject(parent), mediaWidget(NULL),
readFd(-1), writeFd(-1)
{
QString fileName = KStandardDirs::locateLocal("appdata", "dvbpipe.m2t");
QString fileName = KStandardDirs::locateLocal("appdata", QLatin1String("dvbpipe.m2t"));
QFile::remove(fileName);
url = KUrl::fromLocalFile(fileName);
......
......@@ -313,7 +313,7 @@ bool DvbManager::updateScanData(const QByteArray &data)
return false;
}
QFile file(KStandardDirs::locateLocal("appdata", "scanfile.dvb"));
QFile file(KStandardDirs::locateLocal("appdata", QLatin1String("scanfile.dvb")));
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
Log("DvbManager::updateScanData: cannot open") << file.fileName();
......@@ -466,7 +466,7 @@ void DvbManager::deviceRemoved(DvbBackendDevice *backendDevice)
void DvbManager::loadDeviceManager()
{
QDir dir(QString::fromUtf8(KAFFEINE_LIB_INSTALL_DIR "/"));
QStringList entries = dir.entryList(QStringList("*kaffeinedvb*"), QDir::NoFilter,
QStringList entries = dir.entryList(QStringList(QLatin1String("*kaffeinedvb*")), QDir::NoFilter,
QDir::Name | QDir::Reversed);
foreach (const QString &entry, entries) {
......@@ -507,7 +507,7 @@ void DvbManager::loadDeviceManager()
void DvbManager::readDeviceConfigs()
{
QFile file(KStandardDirs::locateLocal("appdata", "config.dvb"));
QFile file(KStandardDirs::locateLocal("appdata", QLatin1String("config.dvb")));
if (!file.open(QIODevice::ReadOnly)) {
Log("DvbManager::readDeviceConfigs: cannot open") << file.fileName();
......@@ -517,13 +517,13 @@ void DvbManager::readDeviceConfigs()
DvbDeviceConfigReader reader(&file);
while (!reader.atEnd()) {
if (reader.readLine() != "[device]") {
if (reader.readLine() != QLatin1String("[device]")) {
continue;
}
QString deviceId = reader.readString("deviceId");
QString frontendName = reader.readString("frontendName");
int configCount = reader.readInt("configCount");
QString deviceId = reader.readString(QLatin1String("deviceId"));
QString frontendName = reader.readString(QLatin1String("frontendName"));
int configCount = reader.readInt(QLatin1String("configCount"));
if (!reader.isValid()) {
break;
......@@ -533,30 +533,30 @@ void DvbManager::readDeviceConfigs()
for (int i = 0; i < configCount; ++i) {
while (!reader.atEnd()) {
if (reader.readLine() == "[config]") {
if (reader.readLine() == QLatin1String("[config]")) {
break;
}
}
DvbConfigBase::TransmissionType type =
reader.readEnum("type", DvbConfigBase::TransmissionTypeMax);
reader.readEnum(QLatin1String("type"), DvbConfigBase::TransmissionTypeMax);
if (!reader.isValid()) {
break;
}
DvbConfigBase *config = new DvbConfigBase(type);