Reopen db before showing indexed MIME types, explain empty list
This commit is contained in:
parent
5c46dbf7da
commit
f0d193e53d
@ -346,9 +346,11 @@ void RclMain::showMissingHelpers()
|
|||||||
|
|
||||||
void RclMain::showActiveTypes()
|
void RclMain::showActiveTypes()
|
||||||
{
|
{
|
||||||
if (rcldb == 0) {
|
string reason;
|
||||||
|
bool maindberror;
|
||||||
|
if (!maybeOpenDb(reason, true, &maindberror)) {
|
||||||
QMessageBox::warning(0, tr("Error"),
|
QMessageBox::warning(0, tr("Error"),
|
||||||
tr("Index not open"),
|
u8s2qs(reason),
|
||||||
QMessageBox::Ok,
|
QMessageBox::Ok,
|
||||||
QMessageBox::NoButton);
|
QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -407,9 +409,14 @@ void RclMain::showActiveTypes()
|
|||||||
editor->setReadOnly(true);
|
editor->setReadOnly(true);
|
||||||
dialog.horizontalLayout->addWidget(editor);
|
dialog.horizontalLayout->addWidget(editor);
|
||||||
|
|
||||||
for (set<string>::const_iterator it = mtypesfromdbconf.begin();
|
if (mtypesfromdbconf.empty()) {
|
||||||
it != mtypesfromdbconf.end(); it++) {
|
editor->append(tr("Types list empty: maybe wait for indexing to "
|
||||||
editor->append(QString::fromUtf8(it->c_str()));
|
"progress?"));
|
||||||
|
} else {
|
||||||
|
for (set<string>::const_iterator it = mtypesfromdbconf.begin();
|
||||||
|
it != mtypesfromdbconf.end(); it++) {
|
||||||
|
editor->append(QString::fromUtf8(it->c_str()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
editor->moveCursor(QTextCursor::Start);
|
editor->moveCursor(QTextCursor::Start);
|
||||||
editor->ensureCursorVisible();
|
editor->ensureCursorVisible();
|
||||||
|
|||||||
@ -55,6 +55,10 @@ inline std::string qs2utf8s(const QString& qs)
|
|||||||
{
|
{
|
||||||
return std::string((const char *)qs.toUtf8());
|
return std::string((const char *)qs.toUtf8());
|
||||||
}
|
}
|
||||||
|
inline QString u8s2qs(const std::string us)
|
||||||
|
{
|
||||||
|
return QString::fromUtf8(us.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
/** Specialized version of the qt file dialog. Can't use getOpenFile()
|
/** Specialized version of the qt file dialog. Can't use getOpenFile()
|
||||||
etc. cause they hide dot files... */
|
etc. cause they hide dot files... */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user