// 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.
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();
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();
// 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();
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
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();
qt_("Local layout file"), filter, false,
label1, dir1);
- if (!suffixIs(fromqstr(file), ".layout"))
+ if (!file.endsWith(".layout"))
return;
FileName layoutFile = makeAbsPath(fromqstr(file),
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();
return font;
}
- LYXERR(Debug::FONT, "Trying " << fromqstr(upper) << " ... ");
+ LYXERR(Debug::FONT, "Trying " << upper << " ... ");
font.setFamily(upper);
if (isChosenFont(font, upper)) {
// 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)) {
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)
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())
break;
}
- lyxerr << fromqstr(bufferFilepath());
+ lyxerr << bufferFilepath();
string const name =
igp.filename.outputFilename(fromqstr(bufferFilepath()));
filename->setText(toqstr(name));
GuiHyperlink::GuiHyperlink(GuiView & lv)
: GuiDialog(lv, "href", qt_("Hyperlink")),
- params_(insetCode(fromqstr("href")))
+ params_(insetCode("href"))
{
setupUi(this);
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
//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());
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 !");
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.
#include "EmptyTable.h"
#include "qt_helpers.h"
-#include "support/gettext.h"
-
-#include <sstream>
#include <QLineEdit>
#include <QPushButton>
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);
{
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();
}
} // namespace frontend
+
QString browseRelFile(QString const & filename, QString const & refpath,
QString const & title, QStringList const & filters, bool save,
QString const & label1, QString const & dir1,
QString const fname = toqstr(makeAbsPath(
fromqstr(filename), fromqstr(refpath)).absFilename());
+
QString const outname =
frontend::browseFile(fname, title, filters, save, label1, dir1, label2, dir2);
}
+
/////////////////////////////////////////////////////////////////////
//
// Helpers
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);
}
}
- lyxerr << "FAILED to find the font: '"
- << foundry << "', '" << family << '\'' <<endl;
+ LYXERR0("FAILED to find the font: '"
+ << foundry << "', '" << family << '\'');
}
+
/////////////////////////////////////////////////////////////////////
//
// PrefPlaintext
{
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();
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;
}
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;
}
}
#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;
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;