Falkon Develop
Cross-platform Qt-based web browser
qmlhistoryitem.cpp
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "qmlhistoryitem.h"
19#include <QQmlEngine>
20
21QmlHistoryItem::QmlHistoryItem(const HistoryEntry &entry, QObject *parent)
22 : QObject(parent)
23 , m_entry(entry)
24{
25 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
26}
27
28int QmlHistoryItem::id() const
29{
30 return m_entry.id;
31}
32
33QString QmlHistoryItem::url() const
34{
35 return QString::fromUtf8(m_entry.url.toEncoded());
36}
37
38QString QmlHistoryItem::title() const
39{
40 return m_entry.title;
41}
42
44{
45 return m_entry.count;
46}
47
48QDateTime QmlHistoryItem::lastVisitTime() const
49{
50 return m_entry.date;
51}
QmlHistoryItem(const HistoryEntry &entry, QObject *parent=nullptr)
QDateTime lastVisitTime
last visit time of the history item
QString title
title of the history item
int visitCount
visit count of the history item
QString url
url of the history item
int id
id of the history item
Definition: history.h:39
QDateTime date
Definition: history.h:42
QString title
Definition: history.h:45
int id
Definition: history.h:40
QUrl url
Definition: history.h:43
int count
Definition: history.h:41