Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c907fcea authored by Kurt Hindenburg's avatar Kurt Hindenburg

remove unneeded casts

parent 50190543
......@@ -106,7 +106,7 @@ QUrl BookmarkHandler::currentUrl() const
QUrl BookmarkHandler::urlForView(ViewProperties *view) const
{
if (view != nullptr) {
return QUrl(view->url());
return view->url();
} else {
return QUrl();
}
......
......@@ -44,39 +44,39 @@ using namespace Konsole;
// gamma correction for the dim colors to compensate for bright X screens.
// It contains the 8 ansiterm/xterm colors in 2 intensities.
const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] = {
ColorEntry(QColor(0x00, 0x00, 0x00)), // Dfore
ColorEntry(QColor(0xFF, 0xFF, 0xFF)), // Dback
ColorEntry(QColor(0x00, 0x00, 0x00)), // Black
ColorEntry(QColor(0xB2, 0x18, 0x18)), // Red
ColorEntry(QColor(0x18, 0xB2, 0x18)), // Green
ColorEntry(QColor(0xB2, 0x68, 0x18)), // Yellow
ColorEntry(QColor(0x18, 0x18, 0xB2)), // Blue
ColorEntry(QColor(0xB2, 0x18, 0xB2)), // Magenta
ColorEntry(QColor(0x18, 0xB2, 0xB2)), // Cyan
ColorEntry(QColor(0xB2, 0xB2, 0xB2)), // White
ColorEntry(0x00, 0x00, 0x00), // Dfore
ColorEntry(0xFF, 0xFF, 0xFF), // Dback
ColorEntry(0x00, 0x00, 0x00), // Black
ColorEntry(0xB2, 0x18, 0x18), // Red
ColorEntry(0x18, 0xB2, 0x18), // Green
ColorEntry(0xB2, 0x68, 0x18), // Yellow
ColorEntry(0x18, 0x18, 0xB2), // Blue
ColorEntry(0xB2, 0x18, 0xB2), // Magenta
ColorEntry(0x18, 0xB2, 0xB2), // Cyan
ColorEntry(0xB2, 0xB2, 0xB2), // White
// intensive versions
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x68, 0x68, 0x68)),
ColorEntry(QColor(0xFF, 0x54, 0x54)),
ColorEntry(QColor(0x54, 0xFF, 0x54)),
ColorEntry(QColor(0xFF, 0xFF, 0x54)),
ColorEntry(QColor(0x54, 0x54, 0xFF)),
ColorEntry(QColor(0xFF, 0x54, 0xFF)),
ColorEntry(QColor(0x54, 0xFF, 0xFF)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x68, 0x68, 0x68),
ColorEntry(0xFF, 0x54, 0x54),
ColorEntry(0x54, 0xFF, 0x54),
ColorEntry(0xFF, 0xFF, 0x54),
ColorEntry(0x54, 0x54, 0xFF),
ColorEntry(0xFF, 0x54, 0xFF),
ColorEntry(0x54, 0xFF, 0xFF),
ColorEntry(0xFF, 0xFF, 0xFF),
// Here are faint intensities, which may not be good.
// faint versions
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0x65, 0x00, 0x00)),
ColorEntry(QColor(0x00, 0x65, 0x00)),
ColorEntry(QColor(0x65, 0x5E, 0x00)),
ColorEntry(QColor(0x00, 0x00, 0x65)),
ColorEntry(QColor(0x65, 0x00, 0x65)),
ColorEntry(QColor(0x00, 0x65, 0x65)),
ColorEntry(QColor(0x65, 0x65, 0x65))
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0x65, 0x00, 0x00),
ColorEntry(0x00, 0x65, 0x00),
ColorEntry(0x65, 0x5E, 0x00),
ColorEntry(0x00, 0x00, 0x65),
ColorEntry(0x65, 0x00, 0x65),
ColorEntry(0x00, 0x65, 0x65),
ColorEntry(0x65, 0x65, 0x65)
};
const char * const ColorScheme::colorNames[TABLE_COLORS] = {
......@@ -363,7 +363,7 @@ void ColorScheme::read(const KConfig &config)
const QString schemeDescription = configGroup.readEntry("Description", i18nc("@item", "Un-named Color Scheme"));
_description = i18n(schemeDescription.toUtf8().constData());
_opacity = configGroup.readEntry("Opacity", qreal(1.0));
_opacity = configGroup.readEntry("Opacity", 1.0);
setWallpaper(configGroup.readEntry("Wallpaper", QString()));
for (int i = 0; i < TABLE_COLORS; i++) {
......
......@@ -225,7 +225,7 @@ void KeyBindingEditor::setupKeyBindingTable(const KeyboardTranslator *translator
QTableWidgetItem *keyItem = new QTableWidgetItem(entry.conditionToString());
keyItem->setData(Qt::UserRole, QVariant::fromValue(entry));
QTableWidgetItem *textItem = new QTableWidgetItem(QString(entry.resultToString()));
QTableWidgetItem *textItem = new QTableWidgetItem(entry.resultToString());
_ui->keyBindingTable->setItem(row, 0, keyItem);
_ui->keyBindingTable->setItem(row, 1, textItem);
......
......@@ -30,39 +30,39 @@
using namespace Konsole;
const ColorEntry CharacterColorTest::DefaultColorTable[TABLE_COLORS] = {
ColorEntry(QColor(0x00, 0x00, 0x00)), // Dfore
ColorEntry(QColor(0xFF, 0xFF, 0xFF)), // Dback
ColorEntry(QColor(0x00, 0x00, 0x00)), // Black
ColorEntry(QColor(0xB2, 0x18, 0x18)), // Red
ColorEntry(QColor(0x18, 0xB2, 0x18)), // Green
ColorEntry(QColor(0xB2, 0x68, 0x18)), // Yellow
ColorEntry(QColor(0x18, 0x18, 0xB2)), // Blue
ColorEntry(QColor(0xB2, 0x18, 0xB2)), // Magenta
ColorEntry(QColor(0x18, 0xB2, 0xB2)), // Cyan
ColorEntry(QColor(0xB2, 0xB2, 0xB2)), // White
ColorEntry(0x00, 0x00, 0x00), // Dfore
ColorEntry(0xFF, 0xFF, 0xFF), // Dback
ColorEntry(0x00, 0x00, 0x00), // Black
ColorEntry(0xB2, 0x18, 0x18), // Red
ColorEntry(0x18, 0xB2, 0x18), // Green
ColorEntry(0xB2, 0x68, 0x18), // Yellow
ColorEntry(0x18, 0x18, 0xB2), // Blue
ColorEntry(0xB2, 0x18, 0xB2), // Magenta
ColorEntry(0x18, 0xB2, 0xB2), // Cyan
ColorEntry(0xB2, 0xB2, 0xB2), // White
// intensive versions
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x68, 0x68, 0x68)),
ColorEntry(QColor(0xFF, 0x54, 0x54)),
ColorEntry(QColor(0x54, 0xFF, 0x54)),
ColorEntry(QColor(0xFF, 0xFF, 0x54)),
ColorEntry(QColor(0x54, 0x54, 0xFF)),
ColorEntry(QColor(0xFF, 0x54, 0xFF)),
ColorEntry(QColor(0x54, 0xFF, 0xFF)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x68, 0x68, 0x68),
ColorEntry(0xFF, 0x54, 0x54),
ColorEntry(0x54, 0xFF, 0x54),
ColorEntry(0xFF, 0xFF, 0x54),
ColorEntry(0x54, 0x54, 0xFF),
ColorEntry(0xFF, 0x54, 0xFF),
ColorEntry(0x54, 0xFF, 0xFF),
ColorEntry(0xFF, 0xFF, 0xFF),
// Here are faint intensities, which may not be good.
// faint versions
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0x65, 0x00, 0x00)),
ColorEntry(QColor(0x00, 0x65, 0x00)),
ColorEntry(QColor(0x65, 0x5E, 0x00)),
ColorEntry(QColor(0x00, 0x00, 0x65)),
ColorEntry(QColor(0x65, 0x00, 0x65)),
ColorEntry(QColor(0x00, 0x65, 0x65)),
ColorEntry(QColor(0x65, 0x65, 0x65))
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x00, 0x00, 0x00),
ColorEntry(0x65, 0x00, 0x00),
ColorEntry(0x00, 0x65, 0x00),
ColorEntry(0x65, 0x5E, 0x00),
ColorEntry(0x00, 0x00, 0x65),
ColorEntry(0x65, 0x00, 0x65),
ColorEntry(0x00, 0x65, 0x65),
ColorEntry(0x65, 0x65, 0x65)
};
void CharacterColorTest::init()
......@@ -75,10 +75,10 @@ void CharacterColorTest::cleanup()
void CharacterColorTest::testColorEntry()
{
ColorEntry black = ColorEntry(QColor(0x00, 0x00, 0x00));
ColorEntry white = ColorEntry(QColor(0xFF, 0xFF, 0xFF));
ColorEntry red = ColorEntry(QColor(0xB2, 0x18, 0x18));
ColorEntry green = ColorEntry(QColor(0x18, 0xB2, 0x18));
ColorEntry black = ColorEntry(0x00, 0x00, 0x00);
ColorEntry white = ColorEntry(0xFF, 0xFF, 0xFF);
ColorEntry red = ColorEntry(0xB2, 0x18, 0x18);
ColorEntry green = ColorEntry(0x18, 0xB2, 0x18);
// Test operator== operator!=
QCOMPARE(black == white, false);
......
......@@ -48,16 +48,16 @@ void TerminalTest::testColorTable()
{
// These are from ColorScheme.cpp but they can be anything to test
const ColorEntry defaultTable[TABLE_COLORS] = {
ColorEntry(QColor(0x00, 0x00, 0x00)), ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x00, 0x00, 0x00)), ColorEntry(QColor(0xB2, 0x18, 0x18)),
ColorEntry(QColor(0x18, 0xB2, 0x18)), ColorEntry(QColor(0xB2, 0x68, 0x18)),
ColorEntry(QColor(0x18, 0x18, 0xB2)), ColorEntry(QColor(0xB2, 0x18, 0xB2)),
ColorEntry(QColor(0x18, 0xB2, 0xB2)), ColorEntry(QColor(0xB2, 0xB2, 0xB2)),
ColorEntry(QColor(0x00, 0x00, 0x00)), ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x68, 0x68, 0x68)), ColorEntry(QColor(0xFF, 0x54, 0x54)),
ColorEntry(QColor(0x54, 0xFF, 0x54)), ColorEntry(QColor(0xFF, 0xFF, 0x54)),
ColorEntry(QColor(0x54, 0x54, 0xFF)), ColorEntry(QColor(0xFF, 0x54, 0xFF)),
ColorEntry(QColor(0x54, 0xFF, 0xFF)), ColorEntry(QColor(0x00, 0xFF, 0xFF))
ColorEntry(0x00, 0x00, 0x00), ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x00, 0x00, 0x00), ColorEntry(0xB2, 0x18, 0x18),
ColorEntry(0x18, 0xB2, 0x18), ColorEntry(0xB2, 0x68, 0x18),
ColorEntry(0x18, 0x18, 0xB2), ColorEntry(0xB2, 0x18, 0xB2),
ColorEntry(0x18, 0xB2, 0xB2), ColorEntry(0xB2, 0xB2, 0xB2),
ColorEntry(0x00, 0x00, 0x00), ColorEntry(0xFF, 0xFF, 0xFF),
ColorEntry(0x68, 0x68, 0x68), ColorEntry(0xFF, 0x54, 0x54),
ColorEntry(0x54, 0xFF, 0x54), ColorEntry(0xFF, 0xFF, 0x54),
ColorEntry(0x54, 0x54, 0xFF), ColorEntry(0xFF, 0x54, 0xFF),
ColorEntry(0x54, 0xFF, 0xFF), ColorEntry(0x00, 0xFF, 0xFF)
};
auto display = new TerminalDisplay(nullptr);
......@@ -70,7 +70,7 @@ void TerminalTest::testColorTable()
QCOMPARE(colorTable[i], defaultTable[i]);
}
ColorEntry colorEntry = ColorEntry(QColor(0x00, 0x00, 0x00));
ColorEntry colorEntry = ColorEntry(0x00, 0x00, 0x00);
QVERIFY(colorTable[1] != colorEntry);
delete display;
......
......@@ -113,7 +113,7 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char *argv[])
parser->addVersionOption();
about.setupCommandLine(parser.data());
QStringList args = QStringList(app->arguments());
QStringList args = app->arguments();
QStringList customCommand = Application::getCustomCommand(args);
Application::populateCommandLineParser(parser.data());
......
......@@ -52,7 +52,7 @@ int main(int argc, char **argv)
parser->addVersionOption();
about.setupCommandLine(parser.data());
QStringList args = QStringList(app->arguments());
QStringList args = app->arguments();
parser->process(args);
about.processCommandLine(parser.data());
......
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