Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real tabs support for browser #46

Merged
merged 156 commits into from
Apr 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
a596e43
[sailfish-browser] New WebView beginning
Jan 20, 2014
0f8a708
Move loadProgress inside WebView
Jan 20, 2014
5a9c34a
Move Tab inside WebView
Jan 20, 2014
ab5501b
Move back and forward navigation functions / properties inside WebView
Jan 20, 2014
5427b6c
Fix fullscreenMode orientation animation condition
Jan 20, 2014
e7b4dc3
Add currentTab to WebView
Jan 20, 2014
87d2957
Fix currentTab viewId
Jan 20, 2014
3e8b991
Move captureScreen function from BrowserPage to WebView
Jan 20, 2014
11c6425
Remove closeAllTabs function from BrowserPage
Jan 21, 2014
a46d0b7
Remove unused deleteTabHistory from BrowserPage
Jan 21, 2014
1e68c0c
Move password query dialog inside WebView
Jan 21, 2014
a00fb99
Move context menu related code inside WebView
Jan 21, 2014
1db062e
Move reload() from BrowserPage to WebView
Jan 21, 2014
fc4879f
Move closeActiveTap handling to be done via tabmodel
Jan 21, 2014
2194464
Remove newTab from BrowserPage and use tab model instead.
Jan 21, 2014
2675ae6
Cleanup BrowserPage title and url
Jan 22, 2014
5e38b8b
Add all remaining prompt and popups
Jan 22, 2014
c3dd3b3
Move favicon inside WebView from BrowserPage
Jan 22, 2014
250949c
Add activeTabChanged signal to tabmodel and load active tab when trig…
Jan 22, 2014
b27c291
Remove closeTab function from BrowserPage
Jan 22, 2014
11a4b94
Remove temporary properties
Jan 22, 2014
f503acd
Remove newTabRequested property from DeclarativeTab
Jan 22, 2014
2122c76
Remove _loadRequested from TabPage
Jan 22, 2014
e1a4dba
Remove obsoleted suspend and resume from WebView interface
Jan 23, 2014
4ea70bd
Add WebPopupHandler for handling popups
Jan 23, 2014
2eabcbb
Add WebPromptHandler for handling JavaScript alert, confirm, and prompt
Jan 23, 2014
b91889f
Move scroll indicators to be children of WebView
Jan 23, 2014
bafe60f
Cut remaining dependencies between WebView and QmlMozView
Jan 23, 2014
2cfc02a
Wrap QmlMozView into Component
Jan 23, 2014
523316a
Take real tabs into use.
Jan 24, 2014
66a9627
Fix context menu
Jan 24, 2014
bb231c9
Rename pageActive to active
Feb 24, 2014
88eded8
Move newTabData inside TabModel
Feb 24, 2014
5d880a5
Replace titleUpdated signal with titleChanged.
Feb 24, 2014
1c6607b
Fix count to be correct once a tab gets closed.
Feb 26, 2014
a294851
Set contentItem (active web view) to null when last view released.
Feb 26, 2014
36ee63a
Defer loading of a new tab until WebView is ready to load it
Feb 26, 2014
e2c6bf5
Do not establish connections to qmlmozview if it is null
Feb 26, 2014
0501ef5
Cleanup WebViewTabCache
Feb 26, 2014
7f43c9b
Add releaseView and activateView for TabModel
Feb 26, 2014
960798e
Cleanup TabModel.newTab not call stop and take screen capture
Feb 26, 2014
f2f1813
Fix loading of initial page that is coming from command line
Feb 26, 2014
2c6919a
Fix download handling to work similar as it was previously
Feb 26, 2014
8dab434
Fix loading of the first QmlMozView instance
Feb 26, 2014
96b5f7c
Add tab debug helper to WebViewTabCache
Feb 26, 2014
06f6596
Cleanup obsolete tab model connections
Feb 26, 2014
189d07b
Cleanup new tab data when tab created directly
Feb 26, 2014
a46e18f
Move TabModel glue into own component
Feb 26, 2014
c232550
Remove obsolete code
Feb 26, 2014
a6d9d8f
Fix removal of screen capture of the previously active tab when new t…
Feb 27, 2014
abaf2f1
Cleanup and merge WebPromptHandler and WebPopupHandler into one
Feb 27, 2014
c5c9944
[sailfish-browser] Fix wrong screen capture removal. Fixes JB#16518
Feb 27, 2014
ca89a08
Cleanup dependencies between BrowserPage and WebView
Feb 27, 2014
d54c588
Guard loading of active tab so that we have always a view
Feb 28, 2014
2355714
Fix tab activation to handle home page loading
Feb 28, 2014
7ab612d
Revert onOpenUrlRequested changes that landed in SHA1 2355714a
Feb 28, 2014
8b602c3
Cleanup start so that browser starts from grid when no tabs available
Mar 3, 2014
a655196
Remove unnecessary return from end of WebView.load function
Mar 3, 2014
4d77ba5
Merge remote-tracking branch 'origin/master' into newWebView
Mar 3, 2014
9750f9a
Enable temporarly dumpping tabs when activating or creating a new tab.
Mar 4, 2014
1957a47
Do not expose _newTabData from TabModel
Mar 4, 2014
2a24012
Dump also title from _dumpTabs function
Mar 5, 2014
6820ec6
[sailfish-browser] Fix downloading of file in case no tabs exists. Fi…
Mar 5, 2014
fbd7991
Add manual window open/close test
Mar 6, 2014
a97eeab
Add lastTabId invokable and tabAdded signal for declarativetabmodel
Mar 6, 2014
5be6ce8
Limit maximum number of real tabs to 5
Mar 6, 2014
a88e481
Add window handling for window.open and window.close functions.
Mar 6, 2014
a54e549
Cleanup meta object property reading from WebContainer.
Mar 6, 2014
45b562d
Merge remote-tracking branch 'origin/master' into newWebView
Mar 6, 2014
7b5bf55
Don't activate tab when new tab data exists
Mar 6, 2014
fbc5f60
Improve window open/close handling
Mar 7, 2014
b973c7c
Don't suspend window that is it a parent for the new window
Mar 10, 2014
bc6ddd0
Merge remote-tracking branch 'origin/master' into newWebView
Mar 10, 2014
0a17209
[sailfish-browser] Update url per tab. Contributes to JB#16845
Mar 10, 2014
2732bbc
[sailfish-browser] Update title per tab. Fixes JB#16845
Mar 11, 2014
85cc3b8
[sailfish-browser] Fix cyclic link from tab history. Fixes JB#17002
Mar 11, 2014
c39b515
Fix closing of last tab.
Mar 12, 2014
142b5ab
Fix ResourceController to handle suspend property when no webView
Mar 12, 2014
9e77942
[sailfish-browser] Remember zoom / scroll position for virtual tabs. …
Mar 12, 2014
623e6a5
Fix loadProgress to progress
Mar 12, 2014
0928c22
[sailfish-browser] Use engine's back/forward navigation when possible…
Mar 14, 2014
522fddf
Fix missing ending from engineering english text
Mar 17, 2014
e060a18
[sailfish-browser] Enable chrome when active tab is changed. Contribu…
Mar 17, 2014
5e1f688
Add qDebug support for Tab class
Mar 18, 2014
f2aa4e8
Fix closing of active tab
Mar 18, 2014
31c1940
Improve tab data update guards
Mar 18, 2014
0e774a2
Fix back / forward navigation error to not trigger load when not needed
Mar 18, 2014
3ee7df7
Cleanup active thumbnail handling
Mar 18, 2014
091d43d
Cleanup unused property
Mar 18, 2014
6f68547
[sailfish-browser] Fix invisible (inactive) tabs to update height. Fi…
Mar 18, 2014
70cb0bb
Add unit tests structure for WebView
Mar 18, 2014
fb48b8f
Merge pull request #44 from rainemak/fixHeightUpdate
Mar 18, 2014
9fd5db3
[sailfish-browser] Fix debug build
rojkov Mar 19, 2014
762909d
[sailfish-browser] Add file upload functionality. Fixes TJC#1006
rojkov Mar 19, 2014
2bf1087
[sailfish-browser] Add git ignores
rojkov Mar 19, 2014
3b25c23
Merge pull request #45 from rainemak/initialWebViewUnitTests
Mar 19, 2014
455e630
Cleanup code
Mar 20, 2014
ae9c969
Fix fetching of parentTabId (parent window)
Mar 20, 2014
b4231b1
Fix loading, loadProgress, and favicon properties to update when tab …
Mar 20, 2014
a703828
Add basic tests for WebView
Mar 20, 2014
c6ae93d
[sailfish-browser] Add file input field to manual test
rojkov Mar 20, 2014
1bb09b3
Merge pull request #51 from sailfishos/tjc1006-nwv
rojkov Mar 20, 2014
cf80590
Merge pull request #54 from rainemak/newWebView
Mar 21, 2014
7188713
Cleanup duplicate resource entry
Mar 21, 2014
d6b082c
[sailfish-browser] Add DeclarativeWebPage containing all browser spec…
Mar 20, 2014
2c3a369
Merge pull request #56 from rainemak/cleanup
Mar 21, 2014
39ca045
[sailfish-browser] Move WebView properties from QML side to C++. Cont…
Mar 20, 2014
75d109e
Merge pull request #57 from rainemak/webViewProperties
Mar 21, 2014
6203574
Merge pull request #58 from rainemak/webPage
Mar 24, 2014
4889825
Change MozView id to webPage and WebView to webView
Mar 21, 2014
8e3b254
Merge pull request #59 from rainemak/task50
Mar 24, 2014
2b9ac7e
[sailfish-browser] Move properties from TabModel to C++ side. Fixes J…
Mar 21, 2014
e1d29f5
Merge pull request #61 from rainemak/tabModelProperties
Mar 24, 2014
aceccac
Rename public getter and setter from DeclarativeWebPage from Declarat…
Mar 24, 2014
56f2ad9
Merge pull request #65 from rainemak/cleanupDeclarativeWebPage
Mar 25, 2014
b11f6c6
Replace WebViewTabCache.js with TabCache C++ class
Mar 24, 2014
fb438a9
Merge pull request #64 from rainemak/tabModelProperties
Mar 26, 2014
bef3593
Improve loaded binding
Mar 26, 2014
f47df47
Merge pull request #67 from rainemak/loadedFix
Mar 27, 2014
1b89322
[sailfish-browser] Hide toolbar while playing full screen video
rojkov Mar 27, 2014
e1c5b21
Merge pull request #62 from sailfishos/html5-fullscreen
rojkov Mar 27, 2014
5a0bead
Move tab destroy handling to C++ when downloading
Mar 25, 2014
930968d
Improve webview unit tests
Mar 27, 2014
a661b75
Merge pull request #66 from rainemak/downloadCleanup
Mar 27, 2014
1b8ee47
Fix real tabs count to work correctly over browser restarts
Mar 28, 2014
9214e72
Merge pull request #70 from rainemak/liveTabCountFix
Mar 31, 2014
57a2597
Move tabModel property to C++ side
Mar 31, 2014
6c80b24
Rename TabCache to WebPages
Mar 31, 2014
4298fb5
Move WebPages to DeclarativeWebContainer's ownership
Mar 31, 2014
fbb507c
Merge pull request #71 from rainemak/webPagesCleanup
Mar 31, 2014
4efb8fc
Merge pull request #68 from rainemak/improveWebViewUnitTests
Mar 31, 2014
5844673
[sailfish-browser] Allow inverted landscape orientation. Contributes …
Mar 31, 2014
e5007ff
Merge pull request #73 from jpetrell/newWebView
Mar 31, 2014
a0af406
Replace firstFrameRendered with domContentLoaded
Mar 26, 2014
670a4d5
Cleanup DeclarativeWebContainer reference from DeclarativeTabModel
Mar 31, 2014
993b6c2
Merge pull request #69 from rainemak/firstFrameRenderedFix
Apr 1, 2014
dfab9d8
[sailfish-browser] First use with real tabs. Contributes to JB#17886
veskuh Apr 1, 2014
8e6ccd7
Merge pull request #75 from veskuh/refactor-start
veskuh Apr 1, 2014
434f589
Send available composition size to embedlite components when virtual …
Apr 1, 2014
83f6cd4
Decrease input field target size
Apr 1, 2014
824b7bd
Minor clenaup for DeclarativeWebPage
Apr 1, 2014
aafcda3
Merge pull request #74 from rainemak/inputFieldZoom
Apr 3, 2014
0c8ec6b
Remove explicit DeclartiveWebPage dependency from DeclarativeTabModel
Apr 3, 2014
b9de61c
Merge pull request #79 from rainemak/dependencyCleanup
Apr 3, 2014
6ae97af
Remove DeclarativeTab class
Apr 2, 2014
af58e0d
Remove Tab::currentLink and Tab::setCurrentLink
Apr 3, 2014
e3279cf
Rename parameter from activeTabChanged signal
Apr 3, 2014
86283f9
Rename DeclartiveTabModel::currentTab() to DeclarativeTabModel::activ…
Apr 3, 2014
92601b4
Cleanup unit tests
Apr 3, 2014
33a4c65
Merge pull request #76 from rainemak/cleanupDeclarativeTab
Apr 3, 2014
4bc1687
Don't let new tab creation to block PageStack animation
Apr 2, 2014
d74946a
Merge pull request #77 from rainemak/fixPageStackPopAnimation
Apr 4, 2014
7023b3a
Merge remote-tracking branch 'origin/master' into newWebView
Apr 7, 2014
f11ba59
Update QtMozEmebed dependency
Apr 7, 2014
1f08268
Cleanups
Apr 7, 2014
9774080
Merge pull request #81 from rainemak/reviewCleanups
Apr 7, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*~
*.swp
*.o
*.moc
moc_*.cpp
*.qm
9 changes: 9 additions & 0 deletions open-url.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=Browser
NotShowIn=X-MeeGo;
X-MeeGo-Logical-Id=sailfish-browser-ap-name
X-MeeGo-Translation-Catalog=sailfish-browser
MimeType=text/html;x-maemo-urischeme/http;x-maemo-urischeme/https;
X-Maemo-Service=org.sailfishos.browser
X-Maemo-Method=org.sailfishos.browser.openUrl
7 changes: 4 additions & 3 deletions rpm/sailfish-browser.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(qt5embedwidget) >= 1.7.3
BuildRequires: pkgconfig(qt5embedwidget) >= 1.8.6
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5Sql)
Expand All @@ -23,8 +23,8 @@ BuildRequires: qt5-qttools-linguist
BuildRequires: gdb
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong line but...

BuildRequires:  pkgconfig(qt5embedwidget) >= 1.7.3

Needs to be updated.

Requires: sailfishsilica-qt5 >= 0.11.8
Requires: jolla-ambient >= 0.3.24
Requires: xulrunner-qt5 >= 26.0.4.1
Requires: embedlite-components-qt5 >= 1.3.11
Requires: xulrunner-qt5 >= 29.0.1.4
Requires: embedlite-components-qt5 >= 1.5.5
Requires: sailfish-browser-settings = %{version}
Requires: qt5-plugin-imageformat-ico
Requires: qt5-plugin-imageformat-gif
Expand Down Expand Up @@ -105,6 +105,7 @@ rm -rf %{buildroot}
# >> files
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/open-url.desktop
%{_datadir}/%{name}/*
%{_datadir}/translations/sailfish-browser_eng_en.qm
%{_datadir}/dbus-1/services/*.service
Expand Down
5 changes: 1 addition & 4 deletions sailfish-browser.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ Name=Web Browser
X-MeeGo-Logical-Id=sailfish-browser-ap-name
X-MeeGo-Translation-Catalog=sailfish-browser
Icon=icon-launcher-browser
Exec=invoker --type=silica-qt5 -s /usr/bin/sailfish-browser %U
Exec=/usr/bin/sailfish-browser %U
Comment=Sailfish UI application
MimeType=text/html;x-maemo-urischeme/http;x-maemo-urischeme/https;
X-Maemo-Service=org.sailfishos.browser
X-Maemo-Method=org.sailfishos.browser.openUrl
2 changes: 1 addition & 1 deletion sailfish-browser.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = subdirs
SUBDIRS += src tests settings

# The .desktop file
desktop.files = sailfish-browser.desktop
desktop.files = sailfish-browser.desktop open-url.desktop
desktop.path = /usr/share/applications

dbus_service.files = org.sailfishos.browser.service
Expand Down
2 changes: 1 addition & 1 deletion src/browser.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "pages"
ApplicationWindow {
id: window

allowedOrientations: WebUtils.firstUseDone ? Orientation.Landscape | Orientation.Portrait : Orientation.Portrait
allowedOrientations: WebUtils.firstUseDone ? Orientation.Landscape | Orientation.Portrait | Orientation.LandscapeInverted : Orientation.Portrait
_defaultPageOrientations: allowedOrientations
initialPage: Component {BrowserPage {}}
cover: undefined
Expand Down
5 changes: 5 additions & 0 deletions src/common.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
isEmpty(DEFAULT_COMPONENT_PATH) {
DEFINES += DEFAULT_COMPONENTS_PATH=\"\\\"/usr/lib/mozembedlite/\\\"\"
} else {
DEFINES += DEFAULT_COMPONENTS_PATH=\"\\\"$$DEFAULT_COMPONENT_PATH\\\"\"
}
15 changes: 10 additions & 5 deletions src/dbmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ DBManager::DBManager(QObject *parent)
connect(worker, SIGNAL(tabsAvailable(QList<Tab>)), this, SLOT(tabListAvailable(QList<Tab>)));
connect(worker, SIGNAL(historyAvailable(QList<Link>)), this, SIGNAL(historyAvailable(QList<Link>)));
connect(worker, SIGNAL(tabHistoryAvailable(int,QList<Link>)), this, SIGNAL(tabHistoryAvailable(int,QList<Link>)));
connect(worker, SIGNAL(navigated(Tab)), this, SIGNAL(navigated(Tab)));
connect(worker, SIGNAL(tabChanged(Tab)), this, SIGNAL(tabChanged(Tab)));
connect(worker, SIGNAL(tabAvailable(Tab)), this, SIGNAL(tabAvailable(Tab)));
connect(worker, SIGNAL(titleChanged(QString,QString)), this, SIGNAL(titleChanged(QString,QString)));
Expand All @@ -52,17 +51,23 @@ DBManager::DBManager(QObject *parent)
Q_RETURN_ARG(SettingsMap, m_settings));
}

int DBManager::getMaxTabId()
{
return m_maxTabId;
}

int DBManager::createTab()
{
QMetaObject::invokeMethod(worker, "createTab", Qt::QueuedConnection, Q_ARG(int, ++m_maxTabId));
return m_maxTabId;
}

int DBManager::createLink(int tabId, QString url)
int DBManager::createLink(int tabId, QString url, QString title)
{
int linkId;
QMetaObject::invokeMethod(worker, "createLink", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(int, linkId), Q_ARG(int, tabId), Q_ARG(QString, url));
Q_RETURN_ARG(int, linkId), Q_ARG(int, tabId),
Q_ARG(QString, url), Q_ARG(QString, title));
return linkId;
}

Expand Down Expand Up @@ -114,10 +119,10 @@ void DBManager::removeAllTabs()
QMetaObject::invokeMethod(worker, "removeAllTabs", Qt::QueuedConnection);
}

void DBManager::updateTitle(QString url, QString title)
void DBManager::updateTitle(int linkId, QString title)
{
QMetaObject::invokeMethod(worker, "updateTitle", Qt::QueuedConnection,
Q_ARG(QString, url), Q_ARG(QString, title));
Q_ARG(int, linkId), Q_ARG(QString, title));
}

void DBManager::updateThumbPath(QString url, QString path, int tabId)
Expand Down
9 changes: 4 additions & 5 deletions src/dbmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DBManager : public QObject
static DBManager *instance();

int createTab();
int createLink(int tabId, QString url);
int createLink(int tabId, QString url, QString title);
void getTab(int tabId);
void getAllTabs();
void removeTab(int tabId);
Expand All @@ -39,7 +39,7 @@ class DBManager : public QObject
void goBack(int tabId);

void updateThumbPath(QString url, QString path, int tabId);
void updateTitle(QString url, QString title);
void updateTitle(int linkId, QString title);

void clearHistory();
void getHistory(const QString &filter = "");
Expand All @@ -50,11 +50,12 @@ class DBManager : public QObject
QString getSetting(QString name);
void deleteSetting(QString name);

int getMaxTabId();

public slots:
void tabListAvailable(QList<Tab> tabs);

signals:
void navigated(Tab tab);
void tabChanged(Tab tab);
void tabAvailable(Tab tab);
void tabsAvailable(QList<Tab> tab);
Expand All @@ -67,8 +68,6 @@ public slots:
private:
DBManager(QObject *parent = 0);

int getMaxTabId();

int m_maxTabId;
QMap<QString, QString> m_settings;

Expand Down
20 changes: 12 additions & 8 deletions src/dbworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ void DBWorker::createTab(int tabId)
execute(query);
}

int DBWorker::createLink(int tabId, QString url)
int DBWorker::createLink(int tabId, QString url, QString title)
{
if (url.isEmpty()) {
return 0;
}

int linkId = createLink(url, "", "");
int linkId = createLink(url, title, "");

if (!addToHistory(linkId)) {
qWarning() << Q_FUNC_INFO << "failed to add url to history" << url;
Expand Down Expand Up @@ -246,7 +246,7 @@ void DBWorker::getTab(int tabId)
if (query.first()) {
#ifdef DEBUG_LOGS
Tab tab = getTabData(query.value(0).toInt(), query.value(1).toInt());
qDebug() << query.value(0).toInt() << query.value(1).toInt() << tab.currentLink().title() << tab.currentLink().url();
qDebug() << query.value(0).toInt() << query.value(1).toInt() << tab.title() << tab.url();
#endif
emit tabAvailable(getTabData(query.value(0).toInt(), query.value(1).toInt()));
}
Expand Down Expand Up @@ -323,7 +323,7 @@ void DBWorker::navigateTo(int tabId, QString url, QString title, QString path) {
#ifdef DEBUG_LOGS
qDebug() << "emit tab changed:" << tabId << historyId << title << url;
#endif
emit navigated(getTabData(tabId, historyId));
emit tabChanged(getTabData(tabId, historyId));
}

void DBWorker::updateTab(int tabId, QString url, QString title, QString path)
Expand Down Expand Up @@ -618,13 +618,17 @@ void DBWorker::updateThumbPath(QString url, QString path, int tabId)
}
}

void DBWorker::updateTitle(QString url, QString title)
void DBWorker::updateTitle(int linkId, QString title)
{
QSqlQuery query = prepare("UPDATE link SET title = ? WHERE url = ?;");
Link link = getLink(linkId);
QSqlQuery query = prepare("UPDATE link SET title = ? WHERE link_id = ?;");
query.bindValue(0, title);
query.bindValue(1, url);
query.bindValue(1, linkId);
if (execute(query)) {
emit titleChanged(url, title);
if (link.isValid() && link.title() != title) {
// For browsing history
emit titleChanged(link.url(), title);
}
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/dbworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DBWorker : public QObject
public slots:
void init();
void createTab(int tabId);
int createLink(int tabId, QString url);
int createLink(int tabId, QString url, QString title);
void removeTab(int tabId);
void removeAllTabs();
void getTab(int tabId);
Expand All @@ -41,7 +41,7 @@ public slots:
void updateTab(int tabId, QString url, QString title, QString path);
int getMaxTabId();

void updateTitle(QString url, QString title);
void updateTitle(int linkId, QString title);
void updateThumbPath(QString url, QString path, int tabId);

void goForward(int tabId);
Expand All @@ -58,7 +58,6 @@ public slots:
signals:
void tabAvailable(Tab tab);
void tabChanged(Tab tab);
void navigated(Tab tab);
void tabsAvailable(QList<Tab> tabs);
void thumbPathChanged(QString url, QString path, int tabId);
void titleChanged(QString url, QString title);
Expand Down
Loading