Commit 7967f42f authored by Jan Möbius's avatar Jan Möbius

Merge branch 'Deprecated_Functions' into 'master'

Deprecated functions

See merge request !177
parents b73365c2 a210ace6
......@@ -321,7 +321,7 @@ void Core::loadPlugins()
for (int i = 0; i < pluginlist.size(); ) {
const QString bn = QFileInfo(pluginlist[i]).fileName();
if (staticPlugins.contains(bn)) {
emit log(LOGOUT, trUtf8("Not loading dynamic %1 as it is statically "
emit log(LOGOUT, tr("Not loading dynamic %1 as it is statically "
"linked against OpenFlipper.").arg(bn));
pluginlist.removeAt(i);
} else {
......
......@@ -931,7 +931,7 @@ bool initializeSettings() {
//==================================================================================================
// Remember the main application directory (assumed to be one above executable Path)
applicationDir_ = QCoreApplication::applicationDirPath();
applicationDir_.setPath( QCoreApplication::applicationDirPath() );
// When using cmake, we get the absolute path to the Application directory via a define
applicationDir_.cd(OPENFLIPPER_APPDIR);
......
......@@ -84,7 +84,7 @@ void QtColorChooserButton::paintEvent(QPaintEvent *ev) {
initStyleOption(&buttonOptions);
QStylePainter painter(this);
const int textWd = buttonOptions.fontMetrics.width(buttonOptions.text);
const int textWd = buttonOptions.fontMetrics.horizontalAdvance(buttonOptions.text);
QRect textRect = buttonOptions.rect;
textRect.setWidth(std::min(textRect.width(), textWd));
painter.drawItemText(textRect, Qt::TextSingleLine | Qt::TextShowMnemonic | Qt::AlignVCenter,
......
......@@ -261,8 +261,8 @@ void Histogram::drawBar(QPainter *painter, Qt::Orientation, const QRect& rect) c
const QRect r = rect.normalized();
const int factor = 125;
const QColor light(color.light(factor));
const QColor dark(color.dark(factor));
const QColor light(color.lighter(factor));
const QColor dark(color.darker(factor));
painter->setBrush(color);
painter->setPen(Qt::NoPen);
......
......@@ -373,7 +373,7 @@ void CoreWidget::slotExaminerSnapshot() {
dialog.setDefaultSuffix("png");
dialog.setNameFilter(tr("Images (*.png *.ppm *.jpg)"));
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setConfirmOverwrite(true);
dialog.setOption(QFileDialog::DontConfirmOverwrite, false);
dialog.setDirectory( fi.path() );
dialog.selectFile( suggest );
dialog.setAcceptMode(QFileDialog::AcceptSave);
......@@ -415,7 +415,7 @@ static QString suggestSnapshotFilename(QString mostRecentPath) {
std::cout << "suggestSnapshotFilename(): Most recent path invalid. "
"Doesn't exist. Returning empty string." << std::endl;
#endif
return QString::null;
return QString();
}
QString base_name = fi.completeBaseName();
......@@ -431,7 +431,7 @@ static QString suggestSnapshotFilename(QString mostRecentPath) {
std::cout << "suggestSnapshotFilename(): Regexp didn't match. This "
"should be impossible." << std::endl;
#endif
return QString::null;
return QString();
}
QString pre = base_name_re.cap(1),
......@@ -484,7 +484,7 @@ static QString suggestSnapshotFilename(QString mostRecentPath) {
std::cout << "suggestSnapshotFilename(): No luck incrementing file_no. "
"Aborting, returning empty string." << std::endl;
#endif
return QString::null;
return QString();
}
///Take a snapshot of the whole application
......
......@@ -47,7 +47,7 @@
FilePicker::FilePicker(QWidget *parent) :
QWidget(parent),
textBox_(new QComboBox),
browseButton_(new QPushButton(trUtf8("Browse..."))),
browseButton_(new QPushButton(tr("Browse..."))),
recent_files_ini_key_("GenericFilePickerRecents"),
dialog_type_(DT_OPEN_FILE),
overwrite_confirmed_by_user_(false) {
......@@ -60,7 +60,7 @@ FilePicker::FilePicker(QString recent_files_ini_key,
QWidget *parent) :
QWidget(parent),
textBox_(new QComboBox),
browseButton_(new QPushButton(trUtf8("Browse..."))),
browseButton_(new QPushButton(tr("Browse..."))),
recent_files_ini_key_(recent_files_ini_key),
dialog_type_(dialog_type),
overwrite_confirmed_by_user_(false) {
......@@ -114,8 +114,8 @@ bool FilePicker::confirm_overwrite_if_necessary() {
const QString file_name = QFileInfo(currentFileName()).fileName();
const QMessageBox::StandardButton result =
QMessageBox::question(
this, trUtf8("Overwrite File?"),
trUtf8("The file \"%1\" exists. "
this, tr("Overwrite File?"),
tr("The file \"%1\" exists. "
"Do you want to overwrite?")
.arg(file_name),
QMessageBox::Yes | QMessageBox::No,
......
......@@ -79,7 +79,7 @@ int TextBrowserWidget::sideAreaWidth() {
++digits;
}
int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
int space = 3 + fontMetrics().horizontalAdvance(QLatin1Char('9')) * digits;
return space;
}
......
......@@ -183,7 +183,7 @@ void SnapshotDialog::findFile()
dialog.setDefaultSuffix("png");
dialog.setNameFilter(tr("Images (*.png *.ppm *.jpg)"));
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setConfirmOverwrite(true);
dialog.setOption(QFileDialog::DontConfirmOverwrite, false);
dialog.setDirectory( fi.path() );
dialog.selectFile( filename->text() );
dialog.setAcceptMode(QFileDialog::AcceptSave);
......@@ -200,11 +200,11 @@ void SnapshotDialog::filenameChanged(const QString &new_filename) {
if (!QFileInfo(fi.path()).isWritable()) {
static const char *style = "background: #ffffcc;";
filename->setStyleSheet(style);
warning_lb->setText(trUtf8("Warning: Folder not writable."));
warning_lb->setText(tr("Warning: Folder not writable."));
} else if (fi.exists()) {
static const char *style = "background: #ffcccc;";
filename->setStyleSheet(style);
warning_lb->setText(trUtf8("Warning: File exists and will be "
warning_lb->setText(tr("Warning: File exists and will be "
"overwritten without further warning."));
} else {
static const char *style = "";
......
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