mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
parent
431782a147
commit
ba1cf804eb
@ -365,6 +365,6 @@ RESOURCES += \
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
message(========== Building libqupzilla ==========)
|
||||
message(===========================================)
|
||||
message( Using following defines:)
|
||||
message($$DEFINES)
|
||||
message( $$DEFINES)
|
||||
|
@ -116,21 +116,43 @@ void LocationCompleter::showMostVisited()
|
||||
|
||||
void LocationCompleter::refreshCompleter(const QString &string)
|
||||
{
|
||||
int limit;
|
||||
if (string.size() < 3) {
|
||||
limit = 25;
|
||||
}
|
||||
else {
|
||||
limit = 15;
|
||||
}
|
||||
|
||||
QSqlQuery query;
|
||||
query.exec("SELECT title, url FROM history WHERE title LIKE '%" + string + "%' OR url LIKE '%" + string + "%' ORDER BY count DESC LIMIT " + QString::number(limit));
|
||||
int limit = string.size() < 3 ? 25 : 15;
|
||||
int i = 0;
|
||||
QString searchString = QString("%%1%").arg(string);
|
||||
|
||||
QStandardItemModel* cModel = qobject_cast<QStandardItemModel*>(model());
|
||||
QTreeView* treeView = qobject_cast<QTreeView*>(popup());
|
||||
|
||||
cModel->clear();
|
||||
|
||||
QSqlQuery query;
|
||||
query.prepare("SELECT title, url, icon FROM bookmarks WHERE title LIKE ? OR url LIKE ? LIMIT ?");
|
||||
query.addBindValue(searchString);
|
||||
query.addBindValue(searchString);
|
||||
query.addBindValue(limit);
|
||||
query.exec();
|
||||
|
||||
while (query.next()) {
|
||||
QStandardItem* iconText = new QStandardItem();
|
||||
QStandardItem* findUrl = new QStandardItem();
|
||||
QString url = query.value(1).toUrl().toEncoded();
|
||||
|
||||
iconText->setIcon(IconProvider::iconFromImage(QImage::fromData(query.value(2).toByteArray())));
|
||||
iconText->setText(query.value(0).toString().replace("\n", "").append("\n" + url));
|
||||
|
||||
findUrl->setText(url);
|
||||
QList<QStandardItem*> items;
|
||||
items.append(iconText);
|
||||
items.append(findUrl);
|
||||
cModel->insertRow(i, items);
|
||||
i++;
|
||||
}
|
||||
|
||||
query.prepare("SELECT title, url FROM history WHERE title LIKE ? OR url LIKE ? ORDER BY count DESC LIMIT ?");
|
||||
query.addBindValue(searchString);
|
||||
query.addBindValue(searchString);
|
||||
query.addBindValue(limit - i);
|
||||
query.exec();
|
||||
|
||||
while (query.next()) {
|
||||
QStandardItem* iconText = new QStandardItem();
|
||||
QStandardItem* findUrl = new QStandardItem();
|
||||
@ -147,20 +169,6 @@ void LocationCompleter::refreshCompleter(const QString &string)
|
||||
i++;
|
||||
}
|
||||
|
||||
// if (i == 0) {
|
||||
// QStandardItem* iconText = new QStandardItem();
|
||||
// QStandardItem* findUrl = new QStandardItem();
|
||||
// QString url("http://www.google.com/search?client=qupzilla&q="+string);
|
||||
|
||||
// iconText->setIcon(QIcon(":/icons/menu/google.png"));
|
||||
// iconText->setText(tr("Search %1 on Google.com\n..........").arg(string));
|
||||
// findUrl->setText(url);
|
||||
// QList<QStandardItem*> items;
|
||||
// items.append(iconText);
|
||||
// items.append(findUrl);
|
||||
// cModel->insertRow(i, items);
|
||||
// }
|
||||
|
||||
treeView->header()->setResizeMode(0, QHeaderView::Stretch);
|
||||
treeView->header()->resizeSection(1, 0);
|
||||
|
||||
|
@ -260,7 +260,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle)
|
||||
PageThumbnailer* thumbnailer = new PageThumbnailer(this);
|
||||
thumbnailer->setUrl(QUrl::fromEncoded(url.toUtf8()));
|
||||
thumbnailer->setLoadTitle(loadTitle);
|
||||
connect(thumbnailer, SIGNAL(thumbnailCreated(const QPixmap&)), this, SLOT(thumbnailCreated(const QPixmap&)));
|
||||
connect(thumbnailer, SIGNAL(thumbnailCreated(const QPixmap &)), this, SLOT(thumbnailCreated(const QPixmap &)));
|
||||
|
||||
thumbnailer->start();
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
void start();
|
||||
|
||||
signals:
|
||||
void thumbnailCreated(const QPixmap&);
|
||||
void thumbnailCreated(const QPixmap &);
|
||||
|
||||
public slots:
|
||||
|
||||
|
@ -23,6 +23,4 @@ OTHER_FILES += appicon.rc \
|
||||
os2:RC_FILE = appicon_os2.rc
|
||||
win32:RC_FILE = appicon.rc
|
||||
|
||||
unix:contains(DEFINES, "NO_SYSTEM_DATAPATH"): QMAKE_RPATHDIR += $$PWD/../../bin
|
||||
|
||||
message(========== Building qupzilla binary ==========)
|
||||
unix:contains(DEFINES, "NO_SYSTEM_DATAPATH"): QMAKE_LFLAGS+=$${QMAKE_LFLAGS_RPATH}\\$\$ORIGIN
|
||||
|
Loading…
Reference in New Issue
Block a user