QString flavorFor(QString const & mime)
{
LYXERR(Debug::ACTION, "flavorFor " << mime);
- if (mime == QLatin1String(pdfMimeType()))
+ if (mime == pdfMimeType())
return QLatin1String("com.adobe.pdf");
return QString();
}
{
LYXERR(Debug::ACTION, "mimeFor " << flav);
if (flav == QLatin1String("com.adobe.pdf"))
- return QLatin1String(pdfMimeType());
+ return pdfMimeType();
return QString();
}
bool canConvert(QString const & mime, QString flav)
- { return mimeFor(flav) == mime; }
+ {
+ return mimeFor(flav) == mime;
+ }
QVariant convertToMime(QString const & mime, QList<QByteArray> data, QString flav)
{
}
if (!enable)
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
case QEvent::FileOpen: {
// Open a file; this happens only on Mac OS X for now
QFileOpenEvent * foe = static_cast<QFileOpenEvent *>(e);
-
- if (!current_view_ || !current_view_->view())
- // The application is not properly initialized yet.
- // So we acknowledge the event and delay the file opening
- // until LyX is ready.
- // FIXME UNICODE: FileName accept an utf8 encoded string.
- LyX::ref().addFileToLoad(fromqstr(foe->file()));
- else
- lyx::dispatch(FuncRequest(LFUN_FILE_OPEN,
- qstring_to_ucs4(foe->file())));
-
+ lyx::dispatch(FuncRequest(LFUN_FILE_OPEN,
+ qstring_to_ucs4(foe->file())));
e->accept();
return true;
}