• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kjots

  • sources
  • kde-4.14
  • kdepim
  • kjots
kjotsbookmarks.cpp
Go to the documentation of this file.
1 //
2 // kjotsbookmarks
3 //
4 // Copyright (C) 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de>
5 // Copyright (C) 2002, 2003 Aaron J. Seigo <aseigo@kde.org>
6 // Copyright (C) 2003 Stanislav Kljuhhin <crz@hot.ee>
7 // Copyright (C) 2005-2006 Jaison Lee <lee.jaison@gmail.com>
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 
24 #include "kjotsbookmarks.h"
25 
26 #include <QItemSelectionModel>
27 
28 #include "kjotsmodel.h"
29 #include "kjotstreeview.h"
30 
31 KJotsBookmarks::KJotsBookmarks( KJotsTreeView *treeView ) :
32  m_treeView( treeView )
33 {
34 }
35 
36 KJotsBookmarks::~KJotsBookmarks()
37 {
38 }
39 
40 void KJotsBookmarks::openBookmark(const KBookmark & bookmark, Qt::MouseButtons, Qt::KeyboardModifiers)
41 {
42 #if 0
43  QModelIndexList rows = m_treeView->model()->match( QModelIndex(), KJotsModel::EntityUrlRole, bookmark.url().url() );
44 
45  if ( rows.isEmpty() )
46  return;
47 
48  // Arbitrarily chooses the first one if multiple are returned.
49  return m_treeView->selectionModel()->select( rows.at( 0 ), QItemSelectionModel::ClearAndSelect );
50 #endif
51 }
52 
53 QString KJotsBookmarks::currentUrl() const
54 {
55  QModelIndexList rows = m_treeView->selectionModel()->selectedRows();
56 
57  if ( rows.size() != 1 )
58  return QString();
59 #if 0
60  return rows.at( 0 ).data( EntityTreeModel::EntityUrlRole ).toString();
61 #else
62  return QString();
63 #endif
64 }
65 
66 QString KJotsBookmarks::currentTitle() const
67 {
68  return m_treeView->captionForSelection( QLatin1String(": ") );
69 }
70 
71 /* kate: tab-indents off; replace-tabs on; tab-width 4; remove-trailing-space on; encoding utf-8;*/
QModelIndex
KJotsTreeView
Definition: kjotstreeview.h:29
KJotsBookmarks::currentUrl
virtual QString currentUrl() const
Definition: kjotsbookmarks.cpp:53
KJotsBookmarks::~KJotsBookmarks
~KJotsBookmarks()
Definition: kjotsbookmarks.cpp:36
kjotstreeview.h
KJotsTreeView::captionForSelection
QString captionForSelection(const QString &sep) const
Definition: kjotstreeview.cpp:105
QString
KJotsBookmarks::currentTitle
virtual QString currentTitle() const
Definition: kjotsbookmarks.cpp:66
kjotsbookmarks.h
Qt::MouseButtons
typedef MouseButtons
QLatin1String
QString::at
const QChar at(int position) const
KJotsBookmarks::openBookmark
virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km)
Definition: kjotsbookmarks.cpp:40
kjotsmodel.h
KJotsBookmarks::KJotsBookmarks
KJotsBookmarks(KJotsTreeView *treeView)
Definition: kjotsbookmarks.cpp:31
Qt::KeyboardModifiers
typedef KeyboardModifiers
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjots

Skip menu "kjots"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal