]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Sun, 20 Apr 2008 21:05:35 +0000 (21:05 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 20 Apr 2008 21:05:35 +0000 (21:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24397 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiClipboard.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiFontLoader.cpp
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/GuiHyperlink.cpp
src/frontends/qt4/GuiIdListModel.cpp
src/frontends/qt4/GuiImage.cpp
src/frontends/qt4/GuiKeySymbol.cpp
src/frontends/qt4/GuiMathMatrix.cpp
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiSelection.cpp
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiWorkArea.cpp

index e25211b0b69712889783e248407e1a710088d429..c0664b0d7b23f3f019ef73afa8f093428d62242c 100644 (file)
@@ -197,10 +197,10 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
                // even if the language calls for RtL, don't do that
                setLayoutDirection(Qt::LeftToRight);
                LYXERR(Debug::GUI, "Successfully installed Qt translations for locale "
-                       << fromqstr(language_name));
+                       << language_name);
        } else
                LYXERR(Debug::GUI, "Could not find  Qt translations for locale "
-                       << fromqstr(language_name));
+                       << language_name);
 
 #ifdef Q_WS_MACX
        // This allows to translate the strings that appear in the LyX menu.
index 3c7798870e4434bf8a9aea077c5ca2a1f0abdc2b..6ef84f5cf064655935c2e0c634df306183cc5ae0 100644 (file)
@@ -197,7 +197,7 @@ QString QMacPasteboardMimeGraphics::convertorName()
 
 QString QMacPasteboardMimeGraphics::flavorFor(QString const & mime)
 {
-       LYXERR(Debug::ACTION, "flavorFor " << fromqstr(mime));
+       LYXERR(Debug::ACTION, "flavorFor " << mime);
        if (mime == QLatin1String(pdf_mime_type))
                return QLatin1String("com.adobe.pdf");
        return QString();
@@ -206,7 +206,7 @@ QString QMacPasteboardMimeGraphics::flavorFor(QString const & mime)
 
 QString QMacPasteboardMimeGraphics::mimeFor(QString flav)
 {
-       LYXERR(Debug::ACTION, "mimeFor " << fromqstr(flav));
+       LYXERR(Debug::ACTION, "mimeFor " << flav);
        if (flav == QLatin1String("com.adobe.pdf"))
                return QLatin1String(pdf_mime_type);
        return QString();
@@ -502,7 +502,7 @@ docstring const GuiClipboard::getAsText() const
        // text data from other applications
        QString const str = qApp->clipboard()->text(QClipboard::Clipboard)
                                .normalized(QString::NormalizationForm_C);
-       LYXERR(Debug::ACTION, "GuiClipboard::getAsText(): `" << fromqstr(str) << "'");
+       LYXERR(Debug::ACTION, "GuiClipboard::getAsText(): `" << str << "'");
        if (str.isNull())
                return docstring();
 
@@ -568,7 +568,7 @@ bool GuiClipboard::hasGraphicsContents(Clipboard::GraphicsType type) const
        QStringList const & formats = source->formats();
        LYXERR(Debug::ACTION, "We found " << formats.size() << " formats");
        for (int i = 0; i < formats.size(); ++i) {
-               LYXERR(Debug::ACTION, "Found format " << fromqstr(formats[i]));
+               LYXERR(Debug::ACTION, "Found format " << formats[i]);
        }
 
        // compute mime for type
@@ -613,9 +613,8 @@ void GuiClipboard::on_dataChanged()
        qApp->clipboard()->mimeData(QClipboard::Clipboard);
        QStringList l = source->formats();
        LYXERR(Debug::ACTION, "Qt Clipboard changed. We found the following mime types:");
-       for (int i = 0; i < l.count(); i++) {
-               LYXERR(Debug::ACTION, fromqstr(l.value(i)));
-       }
+       for (int i = 0; i < l.count(); i++)
+               LYXERR(Debug::ACTION, l.value(i));
        
        text_clipboard_empty_ = qApp->clipboard()->
                text(QClipboard::Clipboard).isEmpty();
index 4eedfbabefa335262e8f21bebefc3dbbd17f9e03..bfedf55bf066530255519b8ccc5d17bf3d372c3e 100644 (file)
@@ -1227,7 +1227,7 @@ void GuiDocument::browseLayout()
                qt_("Local layout file"), filter, false,
                label1, dir1);
 
-       if (!suffixIs(fromqstr(file), ".layout"))
+       if (!file.endsWith(".layout"))
                return;
 
        FileName layoutFile = makeAbsPath(fromqstr(file),
index 9e4a9ca36fd4e791efedc75c1adf0b659389ace1..bad0ebe287cc006466544e72aea7beb50bc8fef7 100644 (file)
@@ -153,8 +153,7 @@ static bool isChosenFont(QFont & font, QString const & family)
 
 QFont symbolFont(QString const & family, bool * ok)
 {
-       LYXERR(Debug::FONT, "Looking for font family "
-               << fromqstr(family) << " ... ");
+       LYXERR(Debug::FONT, "Looking for font family " << family << " ... ");
        QString upper = family;
        upper[0] = family[0].toUpper();
 
@@ -168,7 +167,7 @@ QFont symbolFont(QString const & family, bool * ok)
                return font;
        }
 
-       LYXERR(Debug::FONT, "Trying " << fromqstr(upper) << " ... ");
+       LYXERR(Debug::FONT, "Trying " << upper << " ... ");
        font.setFamily(upper);
 
        if (isChosenFont(font, upper)) {
@@ -180,7 +179,7 @@ QFont symbolFont(QString const & family, bool * ok)
        // A simple setFamily() fails on Qt 2
 
        QString const raw = rawName(family);
-       LYXERR(Debug::FONT, "Trying " << fromqstr(raw) << " ... ");
+       LYXERR(Debug::FONT, "Trying " << raw << " ... ");
        font.setRawName(raw);
 
        if (isChosenFont(font, family)) {
@@ -206,9 +205,8 @@ FontLoader::FontLoader()
                QString const font_file = fonts_dir + '/' + math_fonts[i] + ".ttf";
                int fontID = QFontDatabase::addApplicationFont(font_file);
 
-               LYXERR(Debug::FONT, "Adding font " << fromqstr(font_file)
-                                   << static_cast<const char *>
-                                       (fontID < 0 ? " FAIL" : " OK"));
+               LYXERR(Debug::FONT, "Adding font " << font_file
+                                   << (fontID < 0 ? " FAIL" : " OK"));
        }
 
        for (int i1 = 0; i1 < NUM_FAMILIES; ++i1)
@@ -306,8 +304,8 @@ GuiFontInfo::GuiFontInfo(FontInfo const & f)
                        break;
        }
 
-       LYXERR(Debug::FONT, "Font '" << to_utf8(stateText(f))
-               << "' matched by\n" << fromqstr(font.family()));
+       LYXERR(Debug::FONT, "Font '" << stateText(f)
+               << "' matched by\n" << font.family());
 
        // Is this an exact match?
        if (font.exactMatch())
index 1eff038b7d9c73ef76846dac5750996f6ef6cd1c..069ee24f06a6402f5ea027cb8cd090813a7adb45 100644 (file)
@@ -459,7 +459,7 @@ void GuiGraphics::updateContents()
                        break;
        }
 
-       lyxerr << fromqstr(bufferFilepath());
+       lyxerr << bufferFilepath();
        string const name =
                igp.filename.outputFilename(fromqstr(bufferFilepath()));
        filename->setText(toqstr(name));
index e195ef378de958ec2baa7ffeb3f5a8811afe4354..488321973ac8a2c206744a2f8d8edf72fefe9eff 100644 (file)
@@ -27,7 +27,7 @@ namespace frontend {
 
 GuiHyperlink::GuiHyperlink(GuiView & lv)
        : GuiDialog(lv, "href", qt_("Hyperlink")),
-    params_(insetCode(fromqstr("href")))
+    params_(insetCode("href"))
 {
        setupUi(this);
 
index 17cab6b20ae0d2ee7bd0820c8ca8b5772009cd4f..929d5d3241327f41bde03ace0708e6115bb606c7 100644 (file)
@@ -138,20 +138,6 @@ int GuiIdListModel::findIDString(std::string const & idString)
        return -1;
 }
 
-
-#if 0
-// The following function is currently unused but is retained here in
-//   case it should at some point be useful.
-QStringList GuiIdListModel::getIDStringList() const
-{
-       QStringList qsl;
-       vector<OurData>::const_iterator it  = userData_.begin();
-       vector<OurData>::const_iterator end = userData_.end();
-       for (; it != end; ++it)
-               qsl.append(it->idString.toString());
-       return qsl;
-}
-#endif
 } // namespace frontend
 } // namespace lyx
 
index 75c78a6ee8335b71db7728e7935a009e57a27dec..a308429147368e6bddb94c6f3b9e04f5e816ccff 100644 (file)
@@ -53,7 +53,7 @@ Image::FormatList GuiImage::loadableFormats()
 
        //LYXERR(Debug::GRAPHICS,
        //      "D:/msys/home/yns/src/lyx-devel/lib/images/banner.png mis of format: "
-       //      << fromqstr(Pic.pictureFormat("D:/msys/.../banner.png")))
+       //      << Pic.pictureFormat("D:/msys/.../banner.png"))
        //if (Pic.pictureFormat("D:/msys/.../banner.png"))
        //      LYXERR(Debug::GRAPHICS, "pictureFormat not returned NULL\n"
        //              << "Supported formats are: " << Pic.inputFormats());
index 9a26c125376b2e0072d3d0aac9e31c78a088161b..045bcaccaad37f796664af606067d3d348e95555 100644 (file)
@@ -595,7 +595,7 @@ static char encode(string const & encoding, QString const & str)
                return 0;
        }
 
-       LYXERR(Debug::KEY, "Using codec " << fromqstr(codec->name()));
+       LYXERR(Debug::KEY, "Using codec " << codec->name());
 
        if (!codec->canEncode(str)) {
                LYXERR(Debug::KEY, "Oof. Can't encode the text !");
@@ -616,7 +616,7 @@ void setKeySymbol(KeySymbol * sym, QKeyEvent * ev)
                return;
        }
        LYXERR(Debug::KEY, "Getting key " << ev->key() << ", with text '"
-               << fromqstr(ev->text()) << "'");
+               << ev->text() << "'");
        // This is unsafe because ev->text() is the unicode representation of the
        // key, not the name of the key. For example, Ctrl-x and Alt-x produce 
        // different texts.
index b7dae78b48be2c7ab5b9e00901509a5e52417548..3b0ace1428725fd21e539689568f060d7445581a 100644 (file)
@@ -14,9 +14,6 @@
 
 #include "EmptyTable.h"
 #include "qt_helpers.h"
-#include "support/gettext.h"
-
-#include <sstream>
 
 #include <QLineEdit>
 #include <QPushButton>
@@ -52,9 +49,9 @@ GuiMathMatrix::GuiMathMatrix(GuiView & lv)
                this, SLOT(rowsChanged(int)));
        connect(columnsSB, SIGNAL(valueChanged(int)),
                this, SLOT(columnsChanged(int)) );
-       connect(valignCO, SIGNAL(highlighted(const QString&)),
+       connect(valignCO, SIGNAL(highlighted(QString)),
                this, SLOT(change_adaptor()));
-       connect(halignED, SIGNAL(textChanged(const QString&)),
+       connect(halignED, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
 
        bc().setPolicy(ButtonPolicy::IgnorantPolicy);
@@ -88,15 +85,11 @@ void GuiMathMatrix::slotOK()
 {
        char v_align_c[] = "tcb";
        char const c = v_align_c[valignCO->currentIndex()];
-       string const sh = fromqstr(halignED->text());
-       int const nx = int(columnsSB->value());
-       int const ny = int(rowsSB->value());
-
-       ostringstream os;
-       os << nx << ' ' << ny << ' ' << c << ' ' << sh;
-       dispatchMatrix(os.str().c_str());
-
-       // close the dialog
+       QString const sh = halignED->text();
+       int const nx = columnsSB->value();
+       int const ny = rowsSB->value();
+       dispatchMatrix(fromqstr(
+               QString("%1 %2 %3 %4").arg(nx).arg(ny).arg(c).arg(sh)));
        close();
 }
 
index 3e0a3db0429f9267b3b06f501f9354ad633dbe07..6f9d8d07e680251ac284571604555faef54b5589 100644 (file)
@@ -180,6 +180,7 @@ QString browseDir(QString const & pathname,
 
 } // namespace frontend
 
+
 QString browseRelFile(QString const & filename, QString const & refpath,
        QString const & title, QStringList const & filters, bool save,
        QString const & label1, QString const & dir1,
@@ -188,6 +189,7 @@ QString browseRelFile(QString const & filename, QString const & refpath,
        QString const fname = toqstr(makeAbsPath(
                fromqstr(filename), fromqstr(refpath)).absFilename());
 
+
        QString const outname =
                frontend::browseFile(fname, title, filters, save, label1, dir1, label2, dir2);
 
@@ -201,6 +203,7 @@ QString browseRelFile(QString const & filename, QString const & refpath,
 }
 
 
+
 /////////////////////////////////////////////////////////////////////
 //
 // Helpers
@@ -296,18 +299,18 @@ static void setComboxFont(QComboBox * cb, string const & family,
                font.setStyleHint(QFont::TypeWriter);
                font.setFamily(font_family);
        } else {
-               lyxerr << "FAILED to find the default font: '"
-                      << foundry << "', '" << family << '\''<< endl;
+               LYXERR0("FAILED to find the default font: '"
+                      << foundry << "', '" << family << '\'');
                return;
        }
 
        QFontInfo info(font);
        string default_font_name, dummyfoundry;
        parseFontName(info.family(), default_font_name, dummyfoundry);
-       lyxerr << "Apparent font is " << default_font_name << endl;
+       LYXERR0("Apparent font is " << default_font_name);
 
        for (int i = 0; i < cb->count(); ++i) {
-               lyxerr << "Looking at " << fromqstr(cb->itemText(i)) << endl;
+               LYXERR0("Looking at " << cb->itemText(i));
                if (compare_ascii_no_case(fromqstr(cb->itemText(i)),
                                    default_font_name) == 0) {
                        cb->setCurrentIndex(i);
@@ -315,11 +318,12 @@ static void setComboxFont(QComboBox * cb, string const & family,
                }
        }
 
-       lyxerr << "FAILED to find the font: '"
-              << foundry << "', '" << family << '\'' <<endl;
+       LYXERR0("FAILED to find the font: '"
+              << foundry << "', '" << family << '\'');
 }
 
 
+
 /////////////////////////////////////////////////////////////////////
 //
 // PrefPlaintext
index 23878b32328f49b90117ff6f03b8de9753945cab..e6ee835521f2b4adb555f0522027a8ce037da1b8 100644 (file)
@@ -71,7 +71,7 @@ docstring const GuiSelection::get() const
 {
        QString const str = qApp->clipboard()->text(QClipboard::Selection)
                                .normalized(QString::NormalizationForm_C);
-       LYXERR(Debug::ACTION, "GuiSelection::get: " << fromqstr(str));
+       LYXERR(Debug::ACTION, "GuiSelection::get: " << str);
        if (str.isNull())
                return docstring();
 
index 9f99c0b737fb25913d1158f2c32cc978bf438dfa..a9bff846787efe75d7cb353e368091ba19f0c5ff 100644 (file)
@@ -181,8 +181,8 @@ QString findPng(QString const & name)
                png_name.replace('!', "negthinspace");
        }
 
-       LYXERR(Debug::GUI, "findPng(" << fromqstr(name) << ")\n"
-               << "Looking for math PNG called \"" << fromqstr(png_name) << '"');
+       LYXERR(Debug::GUI, "findPng(" << name << ")\n"
+               << "Looking for math PNG called \"" << png_name << '"');
        return png_name;
 }
 
@@ -683,8 +683,7 @@ void GuiLayoutBox::set(docstring const & layout)
 
        QList<QStandardItem *> r = model_->findItems(name, Qt::MatchExactly, 1);
        if (r.empty()) {
-               lyxerr << "Trying to select non existent layout type "
-                       << fromqstr(name) << endl;
+               LYXERR0("Trying to select non existent layout type " << name);
                return;
        }
 
index 79277e7ff10582389b04b94e1f2331348ab842d1..9bed56018fbdf5663b0c656aad3905c80888d176 100644 (file)
@@ -852,8 +852,7 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * ev)
        }
 #endif
 
-       LYXERR(Debug::KEY, " count: " << ev->count()
-               << " text: " << fromqstr(ev->text())
+       LYXERR(Debug::KEY, " count: " << ev->count() << " text: " << ev->text()
                << " isAutoRepeat: " << ev->isAutoRepeat() << " key: " << ev->key());
 
        KeySymbol sym;
@@ -959,8 +958,8 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
 
        if (!commit_string.isEmpty()) {
 
-               LYXERR(Debug::KEY, "preeditString: " << fromqstr(e->preeditString())
-                       << " commitString: " << fromqstr(e->commitString()));
+               LYXERR(Debug::KEY, "preeditString: " << e->preeditString()
+                       << " commitString: " << e->commitString());
 
                int key = 0;