|
a/src/qtgui/preview_w.cpp |
|
b/src/qtgui/preview_w.cpp |
|
... |
|
... |
502 |
|
502 |
|
503 |
void Preview::setCurTabProps(const Rcl::Doc &doc, int docnum)
|
503 |
void Preview::setCurTabProps(const Rcl::Doc &doc, int docnum)
|
504 |
{
|
504 |
{
|
505 |
LOGDEB1(("PreviewTextEdit::setCurTabProps\n"));
|
505 |
LOGDEB1(("PreviewTextEdit::setCurTabProps\n"));
|
506 |
QString title;
|
506 |
QString title;
|
507 |
map<string,string>::const_iterator meta_it;
|
507 |
string ctitle;
|
508 |
if ((meta_it = doc.meta.find(Rcl::Doc::keytt)) != doc.meta.end()
|
508 |
if (doc.getmeta(Rcl::Doc::keytt, &ctitle)) {
|
509 |
&& !meta_it->second.empty()) {
|
509 |
title = QString::fromUtf8(ctitle.c_str(), ctitle.length());
|
510 |
title = QString::fromUtf8(meta_it->second.c_str(),
|
|
|
511 |
meta_it->second.length());
|
|
|
512 |
} else {
|
510 |
} else {
|
513 |
title = QString::fromLocal8Bit(path_getsimple(doc.url).c_str());
|
511 |
title = QString::fromLocal8Bit(path_getsimple(doc.url).c_str());
|
514 |
}
|
512 |
}
|
515 |
if (title.length() > 20) {
|
513 |
if (title.length() > 20) {
|
516 |
title = title.left(10) + "..." + title.right(10);
|
514 |
title = title.left(10) + "..." + title.right(10);
|
|
... |
|
... |
529 |
LOGDEB(("Doc.url: [%s]\n", doc.url.c_str()));
|
527 |
LOGDEB(("Doc.url: [%s]\n", doc.url.c_str()));
|
530 |
string url;
|
528 |
string url;
|
531 |
printableUrl(theconfig->getDefCharset(), doc.url, url);
|
529 |
printableUrl(theconfig->getDefCharset(), doc.url, url);
|
532 |
string tiptxt = url + string("\n");
|
530 |
string tiptxt = url + string("\n");
|
533 |
tiptxt += doc.mimetype + " " + string(datebuf) + "\n";
|
531 |
tiptxt += doc.mimetype + " " + string(datebuf) + "\n";
|
534 |
if (meta_it != doc.meta.end() && !meta_it->second.empty())
|
532 |
if (!ctitle.empty())
|
535 |
tiptxt += meta_it->second + "\n";
|
533 |
tiptxt += ctitle + "\n";
|
536 |
pvTab->setTabToolTip(curidx,
|
534 |
pvTab->setTabToolTip(curidx,
|
537 |
QString::fromUtf8(tiptxt.c_str(), tiptxt.length()));
|
535 |
QString::fromUtf8(tiptxt.c_str(), tiptxt.length()));
|
538 |
|
536 |
|
539 |
PreviewTextEdit *e = currentEditor();
|
537 |
PreviewTextEdit *e = currentEditor();
|
540 |
if (e) {
|
538 |
if (e) {
|
|
... |
|
... |
964 |
}
|
962 |
}
|
965 |
}
|
963 |
}
|
966 |
|
964 |
|
967 |
|
965 |
|
968 |
// Enter document in document history
|
966 |
// Enter document in document history
|
969 |
map<string,string>::const_iterator udit = idoc.meta.find(Rcl::Doc::keyudi);
|
967 |
string udi;
|
970 |
if (udit != idoc.meta.end())
|
968 |
if (idoc.getmeta(Rcl::Doc::keyudi, &udi)) {
|
971 |
historyEnterDoc(g_dynconf, udit->second);
|
969 |
historyEnterDoc(g_dynconf, udi);
|
|
|
970 |
}
|
972 |
|
971 |
|
973 |
editor->setFocus();
|
972 |
editor->setFocus();
|
974 |
emit(previewExposed(this, m_searchId, docnum));
|
973 |
emit(previewExposed(this, m_searchId, docnum));
|
975 |
LOGDEB(("LoadFileInCurrentTab: returning true\n"));
|
974 |
LOGDEB(("LoadFileInCurrentTab: returning true\n"));
|
976 |
return true;
|
975 |
return true;
|