kdepim: adjust to recent changes

This commit is contained in:
Ivailo Monev 2015-09-25 09:29:33 +00:00
parent 58616c8d1b
commit 383ed74e58
29 changed files with 46 additions and 761 deletions

View file

@ -52,6 +52,7 @@
#include <kabc/contactgroup.h>
#include <kcalcore/incidence.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kconfiggroup.h>

View file

@ -21,6 +21,8 @@
#include <akonadi/collection.h>
#include <KLocale>
using namespace Akonadi;
CollectionAclPage::CollectionAclPage(QWidget * parent) :

View file

@ -21,6 +21,8 @@
#include <akonadi/collection.h>
#include <KLocale>
using namespace Akonadi;
CollectionInternalsPage::CollectionInternalsPage(QWidget * parent) :

View file

@ -24,6 +24,7 @@
#include <KDebug>
#include <KGlobalSettings>
#include <KStandardAction>
#include <KConfigGroup>
#include <QApplication>
#include <QClipboard>

View file

@ -23,6 +23,7 @@
#include "ui_instanceselector.h"
#include <KDebug>
#include <KLocale>
#include <akonadi/private/protocol_p.h>

View file

@ -19,12 +19,9 @@
*/
#include "incidencedescription.h"
#ifdef KDEPIM_MOBILE_UI
#include "ui_dialogmoremobile.h"
#else
#include "ui_dialogdesktop.h"
#endif
#include <KLocale>
#include <KDebug>
#include <KActionCollection>
#include <KToolBar>
@ -46,11 +43,7 @@ class IncidenceDescriptionPrivate
}
#ifdef KDEPIM_MOBILE_UI
IncidenceDescription::IncidenceDescription( Ui::EventOrTodoMore *ui )
#else
IncidenceDescription::IncidenceDescription( Ui::EventOrTodoDesktop *ui )
#endif
: IncidenceEditor( 0 ), mUi( ui ), d( new IncidenceDescriptionPrivate() )
{
setObjectName( "IncidenceDescription" );
@ -63,13 +56,9 @@ IncidenceDescription::IncidenceDescription( Ui::EventOrTodoDesktop *ui )
KRichTextWidget::SupportAlignment |
KRichTextWidget::SupportFormatPainting );
mUi->mRichTextLabel->setContextMenuPolicy(Qt::NoContextMenu);
#ifdef KDEPIM_MOBILE_UI
mUi->mRichTextLabel->hide();
#else
setupToolBar();
connect( mUi->mRichTextLabel, SIGNAL(linkActivated(QString)),
this, SLOT(toggleRichTextDescription()) );
#endif
connect( mUi->mDescriptionEdit, SIGNAL(textChanged()),
this, SLOT(checkDirtyStatus()) );
}

View file

@ -40,11 +40,7 @@ class INCIDENCEEDITORS_NG_EXPORT IncidenceDescription : public IncidenceEditor
{
Q_OBJECT
public:
#ifdef KDEPIM_MOBILE_UI
explicit IncidenceDescription( Ui::EventOrTodoMore *ui );
#else
explicit IncidenceDescription( Ui::EventOrTodoDesktop *ui );
#endif
~IncidenceDescription();
@ -65,11 +61,7 @@ class INCIDENCEEDITORS_NG_EXPORT IncidenceDescription : public IncidenceEditor
void setupToolBar();
private:
#ifdef KDEPIM_MOBILE_UI
Ui::EventOrTodoMore *mUi;
#else
Ui::EventOrTodoDesktop *mUi;
#endif
//@cond PRIVATE
Q_DECLARE_PRIVATE( IncidenceDescription )
IncidenceDescriptionPrivate * const d;

View file

@ -30,6 +30,7 @@
#include <KABC/Addressee>
#include <KConfigGroup>
#include <KLocalizedString>
#include <QCheckBox>

View file

@ -33,6 +33,7 @@
#include <KDebug>
#include <KDialog>
#include <KGlobal>
#include <KLocale>
#include <KLocalizedString>
#include <QCheckBox>

View file

@ -29,6 +29,7 @@
#include <KConfig>
#include <KGlobal>
#include <KLocale>
#include <KLocalizedString>
#include <QPrinter>

View file

@ -1856,7 +1856,7 @@ void Private::windowAdded(WId w)
#ifdef Q_WS_X11
static const int SUPPORTED_TYPES = NET::NormalMask | NET::DesktopMask | NET::DockMask
| NET::ToolbarMask | NET::MenuMask | NET::DialogMask
| NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask;
| NET::TopMenuMask | NET::UtilityMask | NET::SplashMask;
KWindowInfo kwinfo = KWindowSystem::windowInfo(w, NET::WMWindowType | NET::WMName);
if (kwinfo.windowType(SUPPORTED_TYPES) == NET::TopMenu
|| kwinfo.windowType(SUPPORTED_TYPES) == NET::Toolbar

View file

@ -2538,7 +2538,7 @@ FullScreenType haveFullScreenWindow(int screen)
const NETRootInfo rootInfo(display, NET::ClientList | NET::ActiveWindow, screen);
const Window rootWindow = rootInfo.rootWindow();
const Window activeWindow = rootInfo.activeWindow();
const Window* windows = rootInfo.clientList();
const xcb_window_t* windows = rootInfo.clientList();
const int windowCount = rootInfo.clientListCount();
kDebug()<<"Screen"<<screen<<": Window count="<<windowCount<<", active="<<activeWindow<<", geom="<<qApp->desktop()->screenGeometry(screen);
NETRect geom;
@ -2573,7 +2573,7 @@ FullScreenType findFullScreenWindows(const QVector<QRect>& screenRects, QVector<
const NETRootInfo rootInfo(display, NET::ClientList | NET::ActiveWindow, 0);
const Window rootWindow = rootInfo.rootWindow();
const Window activeWindow = rootInfo.activeWindow();
const Window* windows = rootInfo.clientList();
const xcb_window_t* windows = rootInfo.clientList();
const int windowCount = rootInfo.clientListCount();
kDebug()<<"Virtual desktops: Window count="<<windowCount<<", active="<<activeWindow<<", geom="<<qApp->desktop()->screenGeometry(0);
NETRect netgeom;

View file

@ -310,16 +310,9 @@ else()
set(_kleopatra_libkdepim_LIBS kdepim)
endif()
if(KDEPIM_MOBILE_UI)
set(_kleopatra_uiserver_extra_libs ${_kleopatra_uiserver_extra_libs} kdepimmobileui)
set(_kleopatra_mainwindow_SRCS mainwindow_mobile.cpp)
else()
set(_kleopatra_mainwindow_SRCS mainwindow_desktop.cpp)
endif()
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5151)
add_executable(kleopatra_bin ${_kleopatra_SRCS} ${_kleopatra_mainwindow_SRCS} ${_kleopatra_uiserver_SRCS} ${_kleopatra_libkdepim_SRCS})
add_executable(kleopatra_bin ${_kleopatra_SRCS} mainwindow_desktop.cpp ${_kleopatra_uiserver_SRCS} ${_kleopatra_libkdepim_SRCS})
set_target_properties(kleopatra_bin PROPERTIES OUTPUT_NAME kleopatra)
target_link_libraries(kleopatra_bin
@ -353,10 +346,4 @@ install(
install(FILES kleopatra.rc DESTINATION ${DATA_INSTALL_DIR}/kleopatra)
if(KDEPIM_MOBILE_UI)
install(
FILES qml/kleopatra-mobile.qml qml/KleopatraActions.qml
DESTINATION ${DATA_INSTALL_DIR}/kleopatra
)
endif()
add_subdirectory(icons)

View file

@ -45,6 +45,7 @@
#include <gpgme++/key.h>
#include <KGlobal>
#include <KLocalizedString>
#include <QPushButton>

View file

@ -37,6 +37,7 @@
#include <utils/formatting.h>
#include <klocale.h>
#include <kpushbutton.h>
#include <cassert>

View file

@ -38,6 +38,7 @@
#include <selftest/selftest.h>
#include <KLocale>
#include <KDebug>
#include <QAbstractTableModel>

View file

@ -36,6 +36,7 @@
#include "ui_setinitialpindialog.h"
#include <KIcon>
#include <KIconLoader>
#include <KLocalizedString>

View file

@ -1,391 +0,0 @@
/* -*- mode: c++; c-basic-offset:4 -*-
mainwindow_mobile.cpp
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2010 Klarälvdalens Datakonsult AB
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#include <config-kleopatra.h>
#include "mainwindow_mobile.h"
#include "aboutdata.h"
#include "models/keylistmodel.h"
#include "models/keylistsortfilterproxymodel.h"
#include "view/searchbar.h"
#if 0
#include "view/tabwidget.h"
#endif
#include "view/keytreeview.h"
#include "view/keylistcontroller.h"
#include "commands/selftestcommand.h"
#include "commands/importcrlcommand.h"
#include "commands/importcertificatefromfilecommand.h"
#include "commands/decryptverifyfilescommand.h"
#include "commands/signencryptfilescommand.h"
#include "utils/detail_p.h"
#include "utils/gnupg-helper.h"
#include "utils/action_data.h"
#include "utils/classify.h"
#include "utils/filedialog.h"
// from libkdepim
#include "progresswidget/statusbarprogresswidget.h"
#include "progresswidget/progressdialog.h"
// from mobileui
#include "declarativewidgetbase.h"
#include <KActionCollection>
#include <KLocalizedString>
#include <KStandardAction>
#include <KAction>
#include <KAboutData>
#include <KMessageBox>
#include <KStandardGuiItem>
#include <KLineEdit>
#if 0
#include <KShortcutsDialog>
#endif
#include <KAboutApplicationDialog>
#include <kdebug.h>
#include <QTreeView>
#include <QApplication>
#include <QCloseEvent>
#include <QTimer>
#include <QProcess>
#include <QPointer>
#include <QVariant>
#include <QHeaderView>
#include <kleo/stl_util.h>
#include <kleo/cryptobackendfactory.h>
#include <ui/cryptoconfigdialog.h>
#include <kleo/cryptoconfig.h>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
#ifdef Q_OS_WIN32
static const bool OS_WIN = true;
#else
static const bool OS_WIN = false;
#endif
using namespace Kleo;
using namespace Kleo::Commands;
using namespace boost;
using namespace GpgME;
namespace {
static const KAboutData * aboutGpg4WinData() {
static const AboutGpg4WinData data;
return &data;
}
}
class MainWindow::KeyTreeViewItem : public DeclarativeWidgetBase<KeyTreeView,MainWindow,&MainWindow::registerKeyTreeView> {
Q_OBJECT
public:
explicit KeyTreeViewItem( QGraphicsItem * parent=0 )
: DeclarativeWidgetBase<KeyTreeView,MainWindow,&MainWindow::registerKeyTreeView>( parent ) {}
~KeyTreeViewItem() {}
};
class MainWindow::SearchBarItem : public DeclarativeWidgetBase<SearchBar,MainWindow,&MainWindow::registerSearchBar> {
Q_OBJECT
public:
explicit SearchBarItem( QGraphicsItem * parent=0 )
: DeclarativeWidgetBase<SearchBar,MainWindow,&MainWindow::registerSearchBar>( parent ) {}
~SearchBarItem() {}
};
static KGuiItem KStandardGuiItem_quit() {
static const QString app = KGlobal::mainComponent().aboutData()->programName();
KGuiItem item = KStandardGuiItem::quit();
item.setText( i18nc( "Quit [ApplicationName]", "&Quit %1", app ) );
return item;
}
static KGuiItem KStandardGuiItem_close() {
KGuiItem item = KStandardGuiItem::close();
item.setText( i18n("Only &Close Window" ) );
return item;
}
class MainWindow::Private {
friend class ::MainWindow;
MainWindow * const q;
public:
explicit Private( MainWindow * qq );
~Private();
void start( Command * c ) {
c->setParentWidget( q );
c->start();
}
template <typename T>
void createAndStart() {
this->start( new T( this->currentView(), &this->controller ) );
}
template <typename T>
void createAndStart( QAbstractItemView * view ) {
start( new T( view, &this->controller ) );
}
template <typename T>
void createAndStart( const QStringList & a ) {
start( new T( a, this->currentView(), &this->controller ) );
}
template <typename T>
void createAndStart( const QStringList & a, QAbstractItemView * view ) {
start( new T( a, view, &this->controller ) );
}
void closeAndQuit() {
qApp->quit();
}
void selfTest() {
createAndStart<SelfTestCommand>();
}
void configureBackend();
void showHandbook();
void gnupgLogViewer() {
if( !QProcess::startDetached( QLatin1String( "kwatchgnupg" ) ) )
KMessageBox::error( q, i18n( "Could not start the GnuPG Log Viewer (kwatchgnupg). "
"Please check your installation." ),
i18n( "Error Starting KWatchGnuPG" ) );
}
void gnupgAdministrativeConsole() {
if( !QProcess::startDetached( QLatin1String( "kgpgconf" ) ) )
KMessageBox::error( q, i18n( "Could not start the GnuPG Administrative Console (kgpgconf). "
"Please check your installation." ),
i18n( "Error Starting KGpgConf" ) );
}
void slotConfigCommitted();
void slotSearchBarTextChanged( const QString & );
void aboutGpg4Win() {
( new KAboutApplicationDialog( aboutGpg4WinData(), KAboutApplicationDialog::HideKdeVersion|KAboutApplicationDialog::HideTranslators, q ) )->show();
}
private:
void setupActions();
void tryToConnectSearchBarToKeyTreeView() {
if ( searchBar && keyTreeView )
keyTreeView->connectSearchBar( searchBar );
}
QAbstractItemView * currentView() const {
return controller.currentView();
}
private:
QPointer<SearchBar> searchBar;
QPointer<KeyTreeView> keyTreeView;
Kleo::KeyListController controller;
bool firstShow : 1;
};
MainWindow::Private::Private( MainWindow * qq )
: q( qq ),
searchBar(),
keyTreeView(),
controller( q ),
firstShow( true )
{
KDAB_SET_OBJECT_NAME( controller );
AbstractKeyListModel * flatModel = AbstractKeyListModel::createFlatKeyListModel( q );
AbstractKeyListModel * hierarchicalModel = AbstractKeyListModel::createHierarchicalKeyListModel( q );
KDAB_SET_OBJECT_NAME( flatModel );
KDAB_SET_OBJECT_NAME( hierarchicalModel );
controller.setFlatModel( flatModel );
controller.setHierarchicalModel( hierarchicalModel );
controller.setParentWidget( q );
}
MainWindow::Private::~Private() {}
MainWindow::MainWindow( QWidget * parent )
: KDeclarativeFullScreenView( QLatin1String("kleopatra-mobile"), parent ), d( new Private( this ) )
{
}
MainWindow::~MainWindow() {}
void MainWindow::Private::setupActions() {
KActionCollection * const coll = q->actionCollection();
const action_data action_data[] = {
// Settings menu
{ "settings_self_test", i18n("Perform Self-Test"), QString(),
0, q, SLOT(selfTest()), QString(), false, true },
};
make_actions_from_data( action_data, coll );
KStandardAction::close( q, SLOT(close()), coll );
KStandardAction::quit( q, SLOT(closeAndQuit()), coll );
KStandardAction::preferences( qApp, SLOT(openOrRaiseConfigDialog()), coll );
controller.createActions( coll );
}
void MainWindow::doDelayedInit() {
qmlRegisterType<KeyTreeViewItem>( "org.kde.kleopatra", 2, 1, "KeyTreeView" );
qmlRegisterType<SearchBarItem> ( "org.kde.kleopatra", 2, 1, "SearchBar" );
d->setupActions();
engine()->rootContext()->setContextProperty( QLatin1String( "application" ), QVariant::fromValue( static_cast<QObject*>( this ) ) );
}
void MainWindow::registerKeyTreeView( KeyTreeView * view ) {
if ( !view )
return;
view->setFlatModel( d->controller.flatModel() );
view->setHierarchicalModel( d->controller.hierarchicalModel() );
QTreeView * const v = view->view();
v->setItemsExpandable( false );
v->header()->setResizeMode( QHeaderView::Stretch );
v->header()->hide();
d->controller.addView( v );
d->controller.setCurrentView( v );
d->keyTreeView = view;
d->tryToConnectSearchBarToKeyTreeView();
connect( v->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
SIGNAL(certificatesAvailabilityChanged()) );
connect( v->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
SIGNAL(certificatesAvailabilityChanged()) );
connect( v->model(), SIGNAL(modelReset()),
SIGNAL(certificatesAvailabilityChanged()) );
emit certificatesAvailabilityChanged();
}
void MainWindow::registerSearchBar( SearchBar * bar ) {
if ( !bar )
return;
d->searchBar = bar;
bar->setFixedHeight( 0 );
connect( bar, SIGNAL(stringFilterChanged(QString)),
this, SLOT(slotSearchBarTextChanged(QString)) );
d->tryToConnectSearchBarToKeyTreeView();
}
void MainWindow::Private::slotConfigCommitted() {
controller.updateConfig();
}
void MainWindow::closeEvent( QCloseEvent * e ) {
d->closeAndQuit();
// KMainWindow::closeEvent() insists on quitting the application,
// so do not let it touch the event...
kDebug();
if ( d->controller.hasRunningCommands() ) {
if ( d->controller.shutdownWarningRequired() ) {
const int ret = KMessageBox::warningContinueCancel( this, i18n("There are still some background operations ongoing. "
"These will be terminated when closing the window. "
"Proceed?"),
i18n("Ongoing Background Tasks") );
if ( ret != KMessageBox::Continue ) {
e->ignore();
return;
}
}
d->controller.cancelCommands();
if ( d->controller.hasRunningCommands() ) {
// wait for them to be finished:
setEnabled( false );
QEventLoop ev;
QTimer::singleShot( 100, &ev, SLOT(quit()) );
connect( &d->controller, SIGNAL(commandsExecuting(bool)), &ev, SLOT(quit()) );
ev.exec();
kWarning( d->controller.hasRunningCommands() )
<< "controller still has commands running, this may crash now...";
setEnabled( true );
}
}
e->accept();
}
void MainWindow::keyPressEvent( QKeyEvent * e ) {
static bool isSendingEvent = false;
if ( !isSendingEvent && d->searchBar && !e->text().isEmpty() ) {
const struct guard { guard() { isSendingEvent = true; } ~guard() { isSendingEvent = false; } } guard;
QCoreApplication::sendEvent( d->searchBar->lineEdit(), e );
} else {
KDeclarativeFullScreenView::keyPressEvent( e );
}
}
void MainWindow::importCertificatesFromFile( const QStringList & files ) {
if ( !files.empty() )
d->createAndStart<ImportCertificateFromFileCommand>( files );
}
void MainWindow::Private::slotSearchBarTextChanged( const QString & text ) {
if ( text.isEmpty() && searchBar && searchBar->isVisible() ) {
searchBar->setFixedHeight( 0 );
searchBar->hide();
} else if ( !text.isEmpty() && searchBar && !searchBar->isVisible() ) {
searchBar->setFixedHeight( searchBar->minimumSizeHint().height() );
searchBar->show();
searchBar->setFocus();
}
}
bool MainWindow::certificatesAvailable() const {
return (d->keyTreeView && d->keyTreeView->view()->model()->rowCount());
}
#include "moc_mainwindow_mobile.cpp"
#include "mainwindow_mobile.moc"

View file

@ -1,82 +0,0 @@
/* -*- mode: c++; c-basic-offset:4 -*-
mainwindow_mobile.h
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2010 Klarälvdalens Datakonsult AB
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef __KLEOPATRA_MAINWINDOW_MOBILE_H__
#define __KLEOPATRA_MAINWINDOW_MOBILE_H__
#include <kdeclarativefullscreenview.h>
#include <utils/pimpl_ptr.h>
namespace Kleo {
class KeyTreeView;
class SearchBar;
}
class QStringList;
class MainWindow : public KDeclarativeFullScreenView {
Q_OBJECT
Q_PROPERTY( bool certificatesAvailable READ certificatesAvailable NOTIFY certificatesAvailabilityChanged )
public:
explicit MainWindow( QWidget * parent=0 );
~MainWindow();
bool certificatesAvailable() const;
public Q_SLOTS:
void importCertificatesFromFile( const QStringList & files );
Q_SIGNALS:
void certificatesAvailabilityChanged();
protected:
/* reimp */ void doDelayedInit();
/* reimp */ void closeEvent( QCloseEvent * );
/* reimp */ void keyPressEvent( QKeyEvent * );
private:
void registerKeyTreeView( Kleo::KeyTreeView * view );
void registerSearchBar( Kleo::SearchBar * bar );
private:
Q_PRIVATE_SLOT( d, void closeAndQuit() )
Q_PRIVATE_SLOT( d, void selfTest() )
Q_PRIVATE_SLOT( d, void slotSearchBarTextChanged(QString) )
Q_PRIVATE_SLOT( d, void slotConfigCommitted() )
class KeyTreeViewItem;
class SearchBarItem;
class Private;
kdtools::pimpl_ptr<Private> d;
};
#endif /* __KLEOPATRA_MAINWINDOW_MOBILE_H__ */

View file

@ -1,109 +0,0 @@
/* -*- mode: javascript; c-basic-offset:2 -*-
KleopatraActions.qml
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2010 Klarälvdalens Datakonsult AB
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
import Qt 4.7 as QML
import org.kde 4.5
import org.kde.pim.mobileui 4.5
ActionMenuContainer {
menuStyle : true
actionItemHeight : height / 7 - actionItemSpacing
actionItemWidth : 200
actionItemSpacing : 2
ActionList {
category : "home"
name : "file_menu"
text : KDE.i18n( "File" )
ActionListItem { name : "file_new_certificate" }
ActionListItem { name : "file_lookup_certificates" }
ActionListItem { name : "file_import_certificates" }
ActionListItem { name : "file_export_certificates" }
ActionListItem { name : "file_export_secret_keys" }
/* ActionListItem { name : "file_export_certificates_to_server" } */
ActionListItem { name : "file_quit" }
}
ActionList {
category : "home"
name : "view_menu"
text : KDE.i18n( "View" )
ActionListItem { name : "view_redisplay" }
ActionListItem { name : "view_stop_operations" }
ActionListItem { name : "view_certificate_details" }
}
ActionList {
category : "home"
name : "cert_menu"
text : KDE.i18n( "Certificates" )
ActionListItem { name : "certificates_change_owner_trust" }
ActionListItem { name : "certificates_trust_root" }
ActionListItem { name : "certificates_distrust_root" }
ActionListItem { name : "certificates_certify_certificate" }
ActionListItem { name : "certificates_change_expiry" }
ActionListItem { name : "certificates_change_passphrase" }
ActionListItem { name : "certificates_delete" }
ActionListItem { name : "certificates_dump_certificate" }
}
/*ActionList {
category : "home"
name : "tools_menu"
text : KDE.i18n( "Tools" )
ActionListItem { name : "tools_refresh_openpgp_certificates" }
ActionListItem { name : "tools_refresh_x509_certificates" }
ActionListItem { name : "crl_import_crl" }
ActionListItem { name : "crl_clear_crl_cache" }
ActionListItem { name : "crl_dump_crl_cache" }
}*/
ActionList {
category : "home"
name : "settings_menu"
text : KDE.i18n( "Settings" )
ActionListItem { name : "settings_self_test" }
ActionListItem { name : "options_configure" }
}
/*
ActionList {
category : "home"
name : "help_menu"
text : KDE.i18n( "Help" )
ActionListItem { name : "help_about_kleopatra" }
}
*/
}

View file

@ -1,140 +0,0 @@
/* -*- mode: javascript; c-basic-offset:2 -*-
kleopatra-mobile.qml
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2010 Klarälvdalens Datakonsult AB
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
import Qt 4.7 as QML
import org.kde 4.5
import org.kde.pim.mobileui 4.5 as KPIM
import org.kde.kleopatra 2.1 as Kleo
KPIM.MainView {
id: kleopatraMobile;
QML.Rectangle {
anchors.fill : parent
Kleo.KeyTreeView {
id : keyTreeView
anchors.top : parent.top
anchors.topMargin : 35
anchors.bottom : searchBar.top
anchors.left : parent.left
anchors.leftMargin : 30
anchors.right : parent.right
}
Kleo.SearchBar {
id : searchBar
anchors.bottom : parent.bottom
anchors.left : parent.left
anchors.right : parent.right
visible : false
height : 0
y : height == 0 ? parent.height : parent.height - height
}
QML.Rectangle {
anchors.fill : parent
visible : !application.certificatesAvailable
QML.Text {
text : KDE.i18n( "No certificates loaded yet." );
anchors.centerIn : parent
}
}
}
SlideoutPanelContainer {
anchors.fill: parent
SlideoutPanel {
id: actionPanel
titleText: KDE.i18n( "Actions" )
handlePosition : 125
handleHeight: 150
anchors.fill : parent
content : [
KleopatraActions {
id : kleopatraActions
anchors.fill : parent
/*
scriptActions : [
KPIM.ScriptAction {
name : "show_about_dialog"
script : {
actionPanel.collapse();
aboutDialog.visible = true;
}
},
KPIM.ScriptAction {
name : "configure"
script : {
actionPanel.collapse();
configDialog.visible = true;
}
},
KPIM.ScriptAction {
name : "to_selection_screen"
script : {
actionPanel.collapse();
guiStateManager.pushState( KPIM.GuiStateManager.MultipleFolderSelectionScreenState );
}
},
KPIM.ScriptAction {
name : "add_as_favorite"
script : {
actionPanel.collapse();
application.saveFavorite();
}
},
KPIM.ScriptAction {
name : "start_maintenance"
script : {
actionPanel.collapse();
guiStateManager.pushState( KPIM.GuiStateManager.BulkActionScreenState );
}
}
]
*/
onDoCollapse : actionPanel.collapse();
}
]
}
}
}

View file

@ -5,6 +5,10 @@ if(ENABLE_TESTING)
endif()
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
if(BALOO_FOUND)
add_definitions(-DHAVE_BALOO)
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
include_directories(

View file

@ -18,8 +18,10 @@
#include "knotefinddialog.h"
#include "noteshared/widget/notelistwidget.h"
#ifdef HAVE_BALOO
#include "baloo/pim/notequery.h"
#include <baloo/pim/resultiterator.h>
#endif
#include <KLocalizedString>
#include <KLineEdit>
@ -126,15 +128,17 @@ void KNoteFindWidget::slotSearchNote()
query.matchNote(searchStr);
query.matchTitle(searchStr);
Baloo::PIM::ResultIterator it = query.exec();
Akonadi::Item::List lst;
#ifdef HAVE_BALOO
Baloo::PIM::ResultIterator it = query.exec();
while (it.next()) {
const Akonadi::Item::Id id = it.id();
if (mNotes.contains(id)) {
lst << mNotes.value(id);
}
}
#endif
mNoteList->setNotes(lst);
if (lst.isEmpty()) {
mResultSearch->setText(i18n("No Result found."));

View file

@ -33,6 +33,7 @@
#include <KCalCore/Attendee>
#include <KCalCore/Person>
#include <KLocale>
#include <KPIMUtils/Email>
PublishDialog::PublishDialog( QWidget *parent )

View file

@ -18,6 +18,8 @@
#include "selectthunderbirdprofilewidget.h"
#include "ui_selectthunderbirdprofilewidget.h"
#include <KLocale>
#include <QHBoxLayout>
SelectThunderbirdProfileDialog::SelectThunderbirdProfileDialog(QWidget *parent)

View file

@ -2,6 +2,9 @@ project(messagelist)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
if(BALOO_FOUND)
add_definitions(-DHAVE_BALOO)
endif()
option(KDEPIM_FOLDEROPEN_PROFILE "Enable debug output for timing folder loading" FALSE)
configure_file(config-messagelist.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-messagelist.h)

View file

@ -21,8 +21,10 @@
#include "core/filter.h"
#include "core/messageitem.h"
#ifdef HAVE_BALOO
#include <baloo/pim/emailquery.h>
#include <baloo/pim/resultiterator.h>
#endif
using namespace MessageList::Core;
@ -130,6 +132,7 @@ void Filter::setSearchString( const QString &search, QuickSearchLine::SearchOpti
needToSplitString = true;
}
#ifdef HAVE_BALOO
Baloo::PIM::EmailQuery query;
if (options & QuickSearchLine::SearchEveryWhere) {
query.matches(newStr);
@ -156,6 +159,10 @@ void Filter::setSearchString( const QString &search, QuickSearchLine::SearchOpti
while (it.next()) {
mMatchingItemIds << it.id();
}
#else
Q_UNUSED(needToSplitString);
#endif
emit finished();
}

View file

@ -18,6 +18,9 @@
#include "adblockcreatefilterdialog.h"
#include "ui_adblockcreatefilterwidget.h"
#include <KLocale>
#include <KConfigGroup>
#include <QDebug>
using namespace MessageViewer;

View file

@ -22,6 +22,7 @@
#include "templatesconfiguration_kfg.h"
#include "pimcommon/texteditor/richtexteditor/richtexteditor.h"
#include <KLocale>
#include <KMessageBox>
#include <QWhatsThis>