Fix things to build with qt5. Not functional yet: no menus+dumps core on exit...
This commit is contained in:
parent
446a63dff9
commit
1228326982
@ -442,11 +442,16 @@ else
|
||||
qmakevers="`${QMAKE} --version 2>&1`"
|
||||
#echo "qmake version: $qmakevers"
|
||||
v4=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*4.*'`
|
||||
if test X$v4 = X0 ; then
|
||||
v5=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*5.*'`
|
||||
if test X$v4 = X0 -a X$v5 = X0; then
|
||||
AC_MSG_ERROR([qmake seems to be using Qt version 3 which is not supported any more])
|
||||
QTGUI=qtgui
|
||||
else
|
||||
AC_MSG_NOTICE([using qt version 4 user interface])
|
||||
if test X$v4 != X0 ; then
|
||||
AC_MSG_NOTICE([using qt version 4 user interface])
|
||||
else
|
||||
AC_MSG_NOTICE([using qt version 5 user interface])
|
||||
fi
|
||||
QTGUI=qtgui
|
||||
fi
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ size_t AdvSearch::stringToSize(QString qsize)
|
||||
size_t size = size_t(-1);
|
||||
qsize.replace(QRegExp("[\\s]+"), "");
|
||||
if (!qsize.isEmpty()) {
|
||||
string csize((const char*)qsize.toAscii());
|
||||
string csize(qs2utf8s(qsize));
|
||||
char *cp;
|
||||
size = strtoll(csize.c_str(), &cp, 10);
|
||||
if (*cp != 0) {
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qdialog.h>
|
||||
#include <QVariant>
|
||||
#include <QDialog>
|
||||
|
||||
#include "searchclause_w.h"
|
||||
#include "recoll.h"
|
||||
|
||||
@ -77,7 +77,7 @@ bool SDHXMLHandler::startElement(const QString & /* namespaceURI */,
|
||||
const QXmlAttributes &)
|
||||
{
|
||||
LOGDEB2(("SDHXMLHandler::startElement: name [%s]\n",
|
||||
(const char *)qName.toAscii()));
|
||||
(const char *)qName.toUtf8()));
|
||||
if (qName == "SD") {
|
||||
resetTemps();
|
||||
// A new search descriptor. Allocate data structure
|
||||
@ -95,7 +95,7 @@ bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
||||
const QString &qName)
|
||||
{
|
||||
LOGDEB2(("SDHXMLHandler::endElement: name [%s]\n",
|
||||
(const char *)qName.toAscii()));
|
||||
(const char *)qName.toUtf8()));
|
||||
|
||||
if (qName == "CLT") {
|
||||
if (currentText == "OR") {
|
||||
@ -110,7 +110,7 @@ bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
||||
} else if (qName == "T") {
|
||||
text = base64_decode(qs2utf8s(currentText.trimmed()));
|
||||
} else if (qName == "S") {
|
||||
slack = atoi((const char *)currentText.toAscii());
|
||||
slack = atoi((const char *)currentText.toUtf8());
|
||||
} else if (qName == "C") {
|
||||
SearchDataClause *c;
|
||||
if (whatclause == "AND" || whatclause.isEmpty()) {
|
||||
@ -144,11 +144,11 @@ bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
||||
slack = 0;
|
||||
exclude = false;
|
||||
} else if (qName == "D") {
|
||||
d = atoi((const char *)currentText.toAscii());
|
||||
d = atoi((const char *)currentText.toUtf8());
|
||||
} else if (qName == "M") {
|
||||
m = atoi((const char *)currentText.toAscii());
|
||||
m = atoi((const char *)currentText.toUtf8());
|
||||
} else if (qName == "Y") {
|
||||
y = atoi((const char *)currentText.toAscii());
|
||||
y = atoi((const char *)currentText.toUtf8());
|
||||
} else if (qName == "DMI") {
|
||||
di.d1 = d;
|
||||
di.m1 = m;
|
||||
@ -160,28 +160,28 @@ bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
||||
di.y2 = y;
|
||||
hasdates = true;
|
||||
} else if (qName == "MIS") {
|
||||
sd->setMinSize(atoll((const char *)currentText.toAscii()));
|
||||
sd->setMinSize(atoll((const char *)currentText.toUtf8()));
|
||||
} else if (qName == "MAS") {
|
||||
sd->setMaxSize(atoll((const char *)currentText.toAscii()));
|
||||
sd->setMaxSize(atoll((const char *)currentText.toUtf8()));
|
||||
} else if (qName == "ST") {
|
||||
string types = (const char *)currentText.toAscii();
|
||||
string types = (const char *)currentText.toUtf8();
|
||||
vector<string> vt;
|
||||
stringToTokens(types, vt);
|
||||
for (unsigned int i = 0; i < vt.size(); i++)
|
||||
sd->addFiletype(vt[i]);
|
||||
} else if (qName == "IT") {
|
||||
string types = (const char *)currentText.toAscii();
|
||||
string types(qs2utf8s(currentText));
|
||||
vector<string> vt;
|
||||
stringToTokens(types, vt);
|
||||
for (unsigned int i = 0; i < vt.size(); i++)
|
||||
sd->remFiletype(vt[i]);
|
||||
} else if (qName == "YD") {
|
||||
string d;
|
||||
base64_decode((const char*)currentText.trimmed().toAscii(), d);
|
||||
base64_decode(qs2utf8s(currentText.trimmed()), d);
|
||||
sd->addClause(new SearchDataClausePath(d));
|
||||
} else if (qName == "ND") {
|
||||
string d;
|
||||
base64_decode((const char*)currentText.trimmed().toAscii(), d);
|
||||
base64_decode(qs2utf8s(currentText.trimmed()), d);
|
||||
sd->addClause(new SearchDataClausePath(d, true));
|
||||
} else if (qName == "SD") {
|
||||
// Closing current search descriptor. Finishing touches...
|
||||
|
||||
@ -174,7 +174,7 @@ ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink cflink,
|
||||
if (!createCommon(lbltxt, tltptxt))
|
||||
return;
|
||||
m_cmb = new QComboBox(this);
|
||||
m_cmb->setEditable(FALSE);
|
||||
m_cmb->setEditable(false);
|
||||
m_cmb->insertItems(0, sl);
|
||||
|
||||
setSzPol(m_cmb, QSizePolicy::Preferred, QSizePolicy::Fixed, 1, 0);
|
||||
@ -449,7 +449,7 @@ void ConfParamCSLW::showInputDialog()
|
||||
"", // label,
|
||||
m_sl, // items,
|
||||
0, // current = 0
|
||||
FALSE, // editable = true,
|
||||
false, // editable = true,
|
||||
&ok);
|
||||
|
||||
if (ok && !s.isEmpty()) {
|
||||
|
||||
@ -59,9 +59,9 @@ void CronToolW::init()
|
||||
string id = idstring(theconfig->getConfDir());
|
||||
vector<string> sched;
|
||||
if (getCrontabSched(marker, id, sched)) {
|
||||
minsLE->setText(QString::fromAscii(sched[0].c_str()));
|
||||
hoursLE->setText(QString::fromAscii(sched[1].c_str()));
|
||||
daysLE->setText(QString::fromAscii(sched[4].c_str()));
|
||||
minsLE->setText(QString::fromUtf8(sched[0].c_str()));
|
||||
hoursLE->setText(QString::fromUtf8(sched[1].c_str()));
|
||||
daysLE->setText(QString::fromUtf8(sched[4].c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,9 +88,9 @@ void CronToolW::changeCron(bool enable)
|
||||
editCrontab(marker, id, "", "", reason);
|
||||
accept();
|
||||
} else {
|
||||
string mins((const char *)minsLE->text().toAscii());
|
||||
string hours((const char *)hoursLE->text().toAscii());
|
||||
string days((const char *)daysLE->text().toAscii());
|
||||
string mins(qs2utf8s(minsLE->text()));
|
||||
string hours(qs2utf8s(hoursLE->text()));
|
||||
string days(qs2utf8s(daysLE->text()));
|
||||
string sched = mins + " " + hours + " * * " + days;
|
||||
if (editCrontab(marker, id, sched, cmd, reason)) {
|
||||
accept();
|
||||
|
||||
@ -22,13 +22,13 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QRadioButton>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtXml/QXmlDefaultHandler>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QRadioButton>
|
||||
#include <QButtonGroup>
|
||||
#include <QMessageBox>
|
||||
#include <QXmlDefaultHandler>
|
||||
|
||||
#include "fragbuts.h"
|
||||
#include "pathut.h"
|
||||
|
||||
@ -87,7 +87,7 @@ void rwSettings(bool writing)
|
||||
it != prefs.advSearchClauses.end(); it++) {
|
||||
char buf[20];
|
||||
sprintf(buf, "%d ", *it);
|
||||
advSearchClauses += QString::fromAscii(buf);
|
||||
advSearchClauses += QString::fromUtf8(buf);
|
||||
}
|
||||
}
|
||||
SETTING_RW(advSearchClauses, "/Recoll/prefs/adv/clauseList", String, ascdflt);
|
||||
@ -139,7 +139,7 @@ void rwSettings(bool writing)
|
||||
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Int,
|
||||
10);
|
||||
|
||||
QString rlfDflt = QString::fromAscii(prefs.dfltResListFormat);
|
||||
QString rlfDflt = QString::fromUtf8(prefs.dfltResListFormat);
|
||||
if (writing) {
|
||||
if (prefs.reslistformat.compare(rlfDflt)) {
|
||||
settings.setValue("/Recoll/prefs/reslist/format",
|
||||
@ -236,7 +236,7 @@ void rwSettings(bool writing)
|
||||
it != prefs.restableColWidths.end(); it++) {
|
||||
char buf[20];
|
||||
sprintf(buf, "%d ", *it);
|
||||
rtcw += QString::fromAscii(buf);
|
||||
rtcw += QString::fromUtf8(buf);
|
||||
}
|
||||
}
|
||||
SETTING_RW(rtcw, "/Recoll/prefs/query/restableWidths", String,
|
||||
@ -387,7 +387,7 @@ void rwSettings(bool writing)
|
||||
|
||||
string PrefsPack::stemlang()
|
||||
{
|
||||
string stemLang = (const char *)prefs.queryStemLang.toAscii();
|
||||
string stemLang(qs2utf8s(prefs.queryStemLang));
|
||||
if (stemLang == "ALL") {
|
||||
if (theconfig)
|
||||
theconfig->getConfParam("indexstemminglanguages", stemLang);
|
||||
|
||||
@ -188,7 +188,7 @@ void applyStyleSheet(const QString& ssfname)
|
||||
if (cfname && *cfname) {
|
||||
string stylesheet;
|
||||
file_to_string(cfname, stylesheet);
|
||||
qApp->setStyleSheet(QString::fromAscii(stylesheet.c_str()));
|
||||
qApp->setStyleSheet(QString::fromUtf8(stylesheet.c_str()));
|
||||
} else {
|
||||
qApp->setStyleSheet(QString());
|
||||
}
|
||||
|
||||
@ -201,8 +201,8 @@ void Preview::init()
|
||||
QWidget *unnamed = new QWidget(pvTab);
|
||||
QVBoxLayout *unnamedLayout = new QVBoxLayout(unnamed);
|
||||
PreviewTextEdit *pvEdit = new PreviewTextEdit(unnamed, "pvEdit", this);
|
||||
pvEdit->setReadOnly(TRUE);
|
||||
pvEdit->setUndoRedoEnabled(FALSE);
|
||||
pvEdit->setReadOnly(true);
|
||||
pvEdit->setUndoRedoEnabled(false);
|
||||
unnamedLayout->addWidget(pvEdit);
|
||||
pvTab->addTab(unnamed, "");
|
||||
|
||||
@ -232,13 +232,13 @@ void Preview::init()
|
||||
layout3->addWidget(searchTextCMB);
|
||||
|
||||
nextButton = new QPushButton(this);
|
||||
nextButton->setEnabled(TRUE);
|
||||
nextButton->setEnabled(true);
|
||||
layout3->addWidget(nextButton);
|
||||
prevButton = new QPushButton(this);
|
||||
prevButton->setEnabled(TRUE);
|
||||
prevButton->setEnabled(true);
|
||||
layout3->addWidget(prevButton);
|
||||
clearPB = new QPushButton(this);
|
||||
clearPB->setEnabled(FALSE);
|
||||
clearPB->setEnabled(false);
|
||||
layout3->addWidget(clearPB);
|
||||
matchCheck = new QCheckBox(this);
|
||||
layout3->addWidget(matchCheck);
|
||||
@ -397,7 +397,7 @@ bool Preview::eventFilter(QObject *target, QEvent *event)
|
||||
void Preview::searchTextChanged(const QString & text)
|
||||
{
|
||||
LOGDEB1(("Search line text changed. text: '%s'\n",
|
||||
(const char *)text.toAscii()));
|
||||
(const char *)text.toUtf8()));
|
||||
m_searchTextFromIndex = -1;
|
||||
if (text.isEmpty()) {
|
||||
m_dynSearchActive = false;
|
||||
@ -581,8 +581,8 @@ PreviewTextEdit *Preview::addEditorTab()
|
||||
QWidget *anon = new QWidget((QWidget *)pvTab);
|
||||
QVBoxLayout *anonLayout = new QVBoxLayout(anon);
|
||||
PreviewTextEdit *editor = new PreviewTextEdit(anon, "pvEdit", this);
|
||||
editor->setReadOnly(TRUE);
|
||||
editor->setUndoRedoEnabled(FALSE );
|
||||
editor->setReadOnly(true);
|
||||
editor->setUndoRedoEnabled(false );
|
||||
anonLayout->addWidget(editor);
|
||||
pvTab->addTab(anon, "Tab");
|
||||
pvTab->setCurrentIndex(pvTab->count() -1);
|
||||
@ -811,7 +811,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
|
||||
|
||||
QString msg = QString("Loading: %1 (size %2 bytes)")
|
||||
.arg(QString::fromLocal8Bit(idoc.url.c_str()))
|
||||
.arg(QString::fromAscii(idoc.fbytes.c_str()));
|
||||
.arg(QString::fromUtf8(idoc.fbytes.c_str()));
|
||||
|
||||
// Create progress dialog and aux objects
|
||||
const int nsteps = 20;
|
||||
@ -848,7 +848,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
|
||||
if (status != 0) {
|
||||
QString explain;
|
||||
if (!lthr.missing.empty()) {
|
||||
explain = QString::fromAscii("<br>") +
|
||||
explain = QString::fromUtf8("<br>") +
|
||||
tr("Missing helper program: ") +
|
||||
QString::fromLocal8Bit(lthr.missing.c_str());
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
|
||||
@ -60,14 +60,6 @@
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<widget class="QMenuBar" name="MenuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="fileMenu">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
|
||||
@ -197,7 +197,7 @@ void RclMain::init()
|
||||
QAction *id;
|
||||
for (vector<string>::const_iterator it = langs.begin();
|
||||
it != langs.end(); it++) {
|
||||
QString qlang = QString::fromAscii(it->c_str(), it->length());
|
||||
QString qlang = QString::fromUtf8(it->c_str(), it->length());
|
||||
id = preferencesMenu->addAction(qlang);
|
||||
id->setCheckable(true);
|
||||
m_stemLangToId[qlang] = id;
|
||||
@ -222,7 +222,7 @@ void RclMain::init()
|
||||
// Document filter buttons and combobox
|
||||
// Combobox version of the document filter control
|
||||
m_filtCMB = new QComboBox(m_resTB);
|
||||
m_filtCMB->setEditable(FALSE);
|
||||
m_filtCMB->setEditable(false);
|
||||
m_filtCMB->addItem(tr("All"));
|
||||
m_filtCMB->setToolTip(tr("Document filter"));
|
||||
// Buttons version of the document filter control
|
||||
@ -449,8 +449,8 @@ void RclMain::init()
|
||||
m_trayicon = 0;
|
||||
}
|
||||
|
||||
fileRebuildIndexAction->setEnabled(FALSE);
|
||||
fileToggleIndexingAction->setEnabled(FALSE);
|
||||
fileRebuildIndexAction->setEnabled(false);
|
||||
fileToggleIndexingAction->setEnabled(false);
|
||||
// Start timer on a slow period (used for checking ^C). Will be
|
||||
// speeded up during indexing
|
||||
periodictimer->start(1000);
|
||||
@ -635,7 +635,7 @@ void RclMain::setStemLang(QAction *id)
|
||||
}
|
||||
prefs.queryStemLang = lang;
|
||||
LOGDEB(("RclMain::setStemLang(%d): lang [%s]\n",
|
||||
id, (const char *)prefs.queryStemLang.toAscii()));
|
||||
id, (const char *)prefs.queryStemLang.toUtf8()));
|
||||
rwSettings(true);
|
||||
emit stemLangChanged(lang);
|
||||
}
|
||||
@ -643,7 +643,7 @@ void RclMain::setStemLang(QAction *id)
|
||||
// Set the checked stemming language item before showing the prefs menu
|
||||
void RclMain::setStemLang(const QString& lang)
|
||||
{
|
||||
LOGDEB(("RclMain::setStemLang(%s)\n", (const char *)lang.toAscii()));
|
||||
LOGDEB(("RclMain::setStemLang(%s)\n", (const char *)lang.toUtf8()));
|
||||
QAction *id;
|
||||
if (lang == "") {
|
||||
id = m_idNoStem;
|
||||
@ -741,7 +741,7 @@ void RclMain::idxStatus()
|
||||
status.dbtotdocs);
|
||||
else
|
||||
sprintf(cnts, "(%d/%d) ", status.docsdone, status.filesdone);
|
||||
msg += QString::fromAscii(cnts) + " ";
|
||||
msg += QString::fromUtf8(cnts) + " ";
|
||||
}
|
||||
string mf;int ecnt = 0;
|
||||
string fcharset = theconfig->getDefCharset(true);
|
||||
@ -792,23 +792,23 @@ void RclMain::periodic100()
|
||||
if (m_idxproc) {
|
||||
m_indexerState = IXST_RUNNINGMINE;
|
||||
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
|
||||
fileToggleIndexingAction->setEnabled(TRUE);
|
||||
fileRebuildIndexAction->setEnabled(FALSE);
|
||||
fileToggleIndexingAction->setEnabled(true);
|
||||
fileRebuildIndexAction->setEnabled(false);
|
||||
periodictimer->setInterval(200);
|
||||
} else {
|
||||
Pidfile pidfile(theconfig->getPidfile());
|
||||
if (pidfile.open() == 0) {
|
||||
m_indexerState = IXST_NOTRUNNING;
|
||||
fileToggleIndexingAction->setText(tr("Update &Index"));
|
||||
fileToggleIndexingAction->setEnabled(TRUE);
|
||||
fileRebuildIndexAction->setEnabled(TRUE);
|
||||
fileToggleIndexingAction->setEnabled(true);
|
||||
fileRebuildIndexAction->setEnabled(true);
|
||||
periodictimer->setInterval(1000);
|
||||
} else {
|
||||
// Real time or externally started batch indexer running
|
||||
m_indexerState = IXST_RUNNINGNOTMINE;
|
||||
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
|
||||
fileToggleIndexingAction->setEnabled(TRUE);
|
||||
fileRebuildIndexAction->setEnabled(FALSE);
|
||||
fileToggleIndexingAction->setEnabled(true);
|
||||
fileRebuildIndexAction->setEnabled(false);
|
||||
periodictimer->setInterval(200);
|
||||
}
|
||||
}
|
||||
@ -1272,7 +1272,7 @@ void RclMain::showMissingHelpers()
|
||||
QMessageBox::information(this, "", tr("Indexing did not run yet"));
|
||||
return;
|
||||
}
|
||||
QString msg = QString::fromAscii("<p>") +
|
||||
QString msg = QString::fromUtf8("<p>") +
|
||||
tr("External applications/commands needed for your file types "
|
||||
"and not found, as stored by the last indexing pass in ");
|
||||
msg += "<i>";
|
||||
@ -1347,12 +1347,12 @@ void RclMain::showActiveTypes()
|
||||
// We replace the list with an editor so that the user can copy/paste
|
||||
delete dialog.listWidget;
|
||||
QTextEdit *editor = new QTextEdit(dialog.groupBox);
|
||||
editor->setReadOnly(TRUE);
|
||||
editor->setReadOnly(true);
|
||||
dialog.horizontalLayout->addWidget(editor);
|
||||
|
||||
for (set<string>::const_iterator it = mtypesfromdbconf.begin();
|
||||
it != mtypesfromdbconf.end(); it++) {
|
||||
editor->append(QString::fromAscii(it->c_str()));
|
||||
editor->append(QString::fromUtf8(it->c_str()));
|
||||
}
|
||||
editor->moveCursor(QTextCursor::Start);
|
||||
editor->ensureCursorVisible();
|
||||
@ -1528,7 +1528,7 @@ void RclMain::updateIdxForDocs(vector<Rcl::Doc>& docs)
|
||||
m_idxproc->startExec("recollindex", args, false, false);
|
||||
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
|
||||
}
|
||||
fileToggleIndexingAction->setEnabled(FALSE);
|
||||
fileToggleIndexingAction->setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1773,7 +1773,7 @@ void RclMain::newDupsW(const Rcl::Doc, const vector<Rcl::Doc> dups)
|
||||
// We replace the list with an editor so that the user can copy/paste
|
||||
delete dialog.listWidget;
|
||||
QTextEdit *editor = new QTextEdit(dialog.groupBox);
|
||||
editor->setReadOnly(TRUE);
|
||||
editor->setReadOnly(true);
|
||||
dialog.horizontalLayout->addWidget(editor);
|
||||
|
||||
for (vector<Rcl::Doc>::const_iterator it = dups.begin();
|
||||
@ -1839,7 +1839,7 @@ void RclMain::openWith(Rcl::Doc doc, string cmdspec)
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("Bad desktop app spec for %1: [%2]\n"
|
||||
"Please check the desktop file")
|
||||
.arg(QString::fromAscii(doc.mimetype.c_str()))
|
||||
.arg(QString::fromUtf8(doc.mimetype.c_str()))
|
||||
.arg(QString::fromLocal8Bit(cmdspec.c_str())));
|
||||
return;
|
||||
}
|
||||
@ -1896,7 +1896,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("Bad viewer command line for %1: [%2]\n"
|
||||
"Please check the mimeview file")
|
||||
.arg(QString::fromAscii(doc.mimetype.c_str()))
|
||||
.arg(QString::fromUtf8(doc.mimetype.c_str()))
|
||||
.arg(QString::fromLocal8Bit(cmd.c_str())));
|
||||
return;
|
||||
}
|
||||
@ -1928,7 +1928,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
|
||||
// Command not found: start the user dialog to help find another one:
|
||||
if (execpath.empty()) {
|
||||
QString mt = QString::fromAscii(doc.mimetype.c_str());
|
||||
QString mt = QString::fromUtf8(doc.mimetype.c_str());
|
||||
QString message = tr("The viewer specified in mimeview for %1: %2"
|
||||
" is not found.\nDo you want to start the "
|
||||
" preferences dialog ?")
|
||||
@ -1969,7 +1969,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("Viewer command line for %1 specifies both "
|
||||
"file and parent file value: unsupported")
|
||||
.arg(QString::fromAscii(doc.mimetype.c_str())));
|
||||
.arg(QString::fromUtf8(doc.mimetype.c_str())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ LANGUAGE = C++
|
||||
@QMAKE_ENABLE_ZEITGEIST@QMAKE_CXXFLAGS += -DUSE_ZEITGEIST
|
||||
|
||||
QT += xml
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets
|
||||
|
||||
CONFIG += qt warn_on thread release
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include <QTextBlock>
|
||||
#include <QShortcut>
|
||||
#ifndef __APPLE__
|
||||
#include <qx11info_x11.h>
|
||||
//#include <qx11info_x11.h>
|
||||
#endif
|
||||
|
||||
#include "debuglog.h"
|
||||
@ -288,7 +288,7 @@ public:
|
||||
}
|
||||
|
||||
return string("<span class='rclmatch' style='color: ")
|
||||
+ string((const char *)prefs.qtermcolor.toAscii()) + string("'>");
|
||||
+ qs2utf8s(prefs.qtermcolor) + string("'>");
|
||||
}
|
||||
virtual string endMatch()
|
||||
{
|
||||
@ -329,8 +329,7 @@ ResList::ResList(QWidget* parent, const char* name)
|
||||
languageChange();
|
||||
|
||||
(void)new HelpClient(this);
|
||||
HelpClient::installMap((const char *)this->objectName().toAscii(),
|
||||
"RCL.SEARCH.RESLIST");
|
||||
HelpClient::installMap(qs2utf8s(this->objectName()), "RCL.SEARCH.RESLIST");
|
||||
|
||||
#if 0
|
||||
// See comments in "highlighted
|
||||
@ -465,7 +464,7 @@ void ResList::resetView()
|
||||
QTextBrowser::append(".");
|
||||
clear();
|
||||
#ifndef __APPLE__
|
||||
XFlush(QX11Info::display());
|
||||
// XFlush(QX11Info::display());
|
||||
#endif
|
||||
#else
|
||||
m_text = "";
|
||||
@ -786,7 +785,7 @@ void ResList::previewExposed(int docnum)
|
||||
QString sel =
|
||||
QString("div[rcldocnum=\"%1\"]").arg(m_curPvDoc - pageFirstDocNum());
|
||||
LOGDEB2(("Searching for element, selector: [%s]\n",
|
||||
(const char *)sel.toAscii()));
|
||||
qs2utf8s(sel).c_str()));
|
||||
QWebElement elt = page()->mainFrame()->findFirstElement(sel);
|
||||
if (!elt.isNull()) {
|
||||
LOGDEB2(("Found\n"));
|
||||
@ -823,7 +822,7 @@ void ResList::previewExposed(int docnum)
|
||||
QString sel =
|
||||
QString("div[rcldocnum=\"%1\"]").arg(docnum - pageFirstDocNum());
|
||||
LOGDEB2(("Searching for element, selector: [%s]\n",
|
||||
(const char *)sel.toAscii()));
|
||||
qs2utf8s(sel).c_str()));
|
||||
QWebElement elt = page()->mainFrame()->findFirstElement(sel);
|
||||
if (!elt.isNull()) {
|
||||
LOGDEB2(("Found\n"));
|
||||
@ -860,7 +859,7 @@ void ResList::showQueryDetails()
|
||||
|
||||
void ResList::linkWasClicked(const QUrl &url)
|
||||
{
|
||||
string ascurl = (const char *)url.toString().toAscii();;
|
||||
string ascurl = qs2utf8s(url.toString());
|
||||
LOGDEB(("ResList::linkWasClicked: [%s]\n", ascurl.c_str()));
|
||||
|
||||
int what = ascurl[0];
|
||||
|
||||
@ -30,7 +30,7 @@ using std::pair;
|
||||
#include <QTextBrowser>
|
||||
#define RESLIST_PARENTCLASS QTextBrowser
|
||||
#else
|
||||
#include <QtWebKit/QWebView>
|
||||
#include <QWebView>
|
||||
#define RESLIST_PARENTCLASS QWebView
|
||||
#endif
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
virtual string startMatch(unsigned int)
|
||||
{
|
||||
return string("<span style='color: ")
|
||||
+ string((const char *)prefs.qtermcolor.toAscii()) + string("'>");
|
||||
+ qs2utf8s(prefs.qtermcolor) + string("'>");
|
||||
}
|
||||
virtual string endMatch() {return string("</span>");}
|
||||
};
|
||||
@ -286,7 +286,8 @@ int RecollModel::columnCount(const QModelIndex&) const
|
||||
void RecollModel::readDocSource()
|
||||
{
|
||||
LOGDEB(("RecollModel::readDocSource()\n"));
|
||||
reset();
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void RecollModel::setDocSource(RefCntr<DocSequence> nsource)
|
||||
@ -459,8 +460,8 @@ public:
|
||||
pen.setBrush(opt.palette.brush(QPalette::HighlightedText));
|
||||
painter->setPen(pen);
|
||||
#else
|
||||
text = QString::fromAscii("<div style='color: white'> ") +
|
||||
text + QString::fromAscii("</div>");
|
||||
text = QString::fromUtf8("<div style='color: white'> ") +
|
||||
text + QString::fromUtf8("</div>");
|
||||
#endif
|
||||
}
|
||||
painter->setClipRect(option.rect);
|
||||
@ -508,7 +509,11 @@ void ResTable::init()
|
||||
connect(header, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||
this, SLOT(createHeaderPopupMenu(const QPoint&)));
|
||||
}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
header->setSectionsMovable(true);
|
||||
#else
|
||||
header->setMovable(true);
|
||||
#endif
|
||||
|
||||
header = tableView->verticalHeader();
|
||||
if (header) {
|
||||
@ -540,9 +545,9 @@ void ResTable::init()
|
||||
|
||||
delete textBrowser;
|
||||
m_detail = new ResTableDetailArea(this);
|
||||
m_detail->setReadOnly(TRUE);
|
||||
m_detail->setUndoRedoEnabled(FALSE);
|
||||
m_detail->setOpenLinks(FALSE);
|
||||
m_detail->setReadOnly(true);
|
||||
m_detail->setUndoRedoEnabled(false);
|
||||
m_detail->setOpenLinks(false);
|
||||
// signals and slots connections
|
||||
connect(m_detail, SIGNAL(anchorClicked(const QUrl &)),
|
||||
this, SLOT(linkWasClicked(const QUrl &)));
|
||||
@ -755,7 +760,7 @@ void ResTable::linkWasClicked(const QUrl &url)
|
||||
return;
|
||||
}
|
||||
QString s = url.toString();
|
||||
const char *ascurl = s.toAscii();
|
||||
const char *ascurl = s.toUtf8();
|
||||
LOGDEB(("ResTable::linkWasClicked: [%s]\n", ascurl));
|
||||
|
||||
int i = atoi(ascurl+1) -1;
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
virtual string startMatch(unsigned int)
|
||||
{
|
||||
return string("<span class='rclmatch' style='color: ")
|
||||
+ string((const char *)prefs.qtermcolor.toAscii()) + string("'>");
|
||||
+ qs2utf8s(prefs.qtermcolor) + string("'>");
|
||||
}
|
||||
virtual string endMatch()
|
||||
{
|
||||
|
||||
@ -93,7 +93,7 @@ void SpellW::init()
|
||||
for (vector<string>::const_iterator it = langs.begin();
|
||||
it != langs.end(); it++) {
|
||||
stemLangCMB->
|
||||
addItem(QString::fromAscii(it->c_str(), it->length()));
|
||||
addItem(QString::fromUtf8(it->c_str(), it->length()));
|
||||
}
|
||||
|
||||
(void)new HelpClient(this);
|
||||
@ -109,7 +109,11 @@ void SpellW::init()
|
||||
connect(expTypeCMB, SIGNAL(activated(int)), this, SLOT(modeSet(int)));
|
||||
|
||||
resTW->setShowGrid(0);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
resTW->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
#else
|
||||
resTW->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
|
||||
#endif
|
||||
resTW->verticalHeader()->setDefaultSectionSize(20);
|
||||
connect(resTW,
|
||||
SIGNAL(cellDoubleClicked(int, int)),
|
||||
@ -260,7 +264,7 @@ void SpellW::doExpand()
|
||||
resTW->setItem(row, 0,
|
||||
new QTableWidgetItem(QString::fromUtf8(it->term.c_str())));
|
||||
resTW->setItem(row++, 1,
|
||||
new QTableWidgetItem(QString::fromAscii(num)));
|
||||
new QTableWidgetItem(QString::fromUtf8(num)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ bool SSearch::startSimpleSearch(const string& u8, int maxexp)
|
||||
sdata = wasaStringToRcl(theconfig, stemlang, u8, reason);
|
||||
if (sdata == 0) {
|
||||
QMessageBox::warning(0, "Recoll", tr("Bad query string") + ": " +
|
||||
QString::fromAscii(reason.c_str()));
|
||||
QString::fromUtf8(reason.c_str()));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -184,8 +184,8 @@ void UIPrefsDialog::setFromPrefs()
|
||||
for (vector<string>::const_iterator it = langs.begin();
|
||||
it != langs.end(); it++) {
|
||||
stemLangCMB->
|
||||
addItem(QString::fromAscii(it->c_str(), it->length()));
|
||||
if (cur == 0 && !strcmp((const char*)prefs.queryStemLang.toAscii(),
|
||||
addItem(QString::fromUtf8(it->c_str(), it->length()));
|
||||
if (cur == 0 && !strcmp((const char*)prefs.queryStemLang.toUtf8(),
|
||||
it->c_str())) {
|
||||
cur = stemLangCMB->count();
|
||||
}
|
||||
|
||||
@ -88,12 +88,12 @@ void ViewAction::fillLists()
|
||||
for (vector<pair<string, string> >::const_iterator it = defs.begin();
|
||||
it != defs.end(); it++) {
|
||||
actionsLV->setItem(row, 0,
|
||||
new QTableWidgetItem(QString::fromAscii(it->first.c_str())));
|
||||
new QTableWidgetItem(QString::fromUtf8(it->first.c_str())));
|
||||
if (!prefs.useDesktopOpen ||
|
||||
viewerXs.find(it->first) != viewerXs.end()) {
|
||||
actionsLV->setItem(
|
||||
row, 1,
|
||||
new QTableWidgetItem(QString::fromAscii(it->second.c_str())));
|
||||
new QTableWidgetItem(QString::fromUtf8(it->second.c_str())));
|
||||
} else {
|
||||
actionsLV->setItem(
|
||||
row, 1, new QTableWidgetItem(tr("Desktop Default")));
|
||||
@ -119,7 +119,6 @@ void ViewAction::selectMT(const QString& mt)
|
||||
|
||||
void ViewAction::onSelSameClicked()
|
||||
{
|
||||
fprintf(stderr, "onSelSameClicked()\n");
|
||||
actionsLV->clearSelection();
|
||||
QString value = currentLBL->text();
|
||||
if (value.isEmpty())
|
||||
@ -131,7 +130,7 @@ void ViewAction::onSelSameClicked()
|
||||
for (unsigned int i = 0; i < defs.size(); i++) {
|
||||
if (defs[i].second == action) {
|
||||
QList<QTableWidgetItem *>items =
|
||||
actionsLV->findItems(QString::fromAscii(defs[i].first.c_str()),
|
||||
actionsLV->findItems(QString::fromUtf8(defs[i].first.c_str()),
|
||||
Qt::MatchFixedString|Qt::MatchCaseSensitive);
|
||||
for (QList<QTableWidgetItem *>::iterator it = items.begin();
|
||||
it != items.end(); it++) {
|
||||
@ -153,7 +152,7 @@ void ViewAction::onItemClicked(QTableWidgetItem * item)
|
||||
theconfig->getMimeViewerDefs(defs);
|
||||
for (unsigned int i = 0; i < defs.size(); i++) {
|
||||
if (defs[i].first == mtype) {
|
||||
currentLBL->setText(QString::fromAscii(defs[i].second.c_str()));
|
||||
currentLBL->setText(QString::fromUtf8(defs[i].second.c_str()));
|
||||
selSamePB->setEnabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user