Commit 6f92d6b6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove them. It's not really necessary

parent ef64512f
......@@ -48,8 +48,6 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
option(KDEPIMADDONS_BUILD_EXAMPLES "Build the kdepim-addons example applications." TRUE)
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets Widgets Test)
......@@ -152,9 +150,6 @@ endif()
add_definitions(-DQT_NO_FOREACH)
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
if(KDEPIMADDONS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(QTCREATOR_TEMPLATE_INSTALL_DIR ${KDE_INSTALL_DATADIR}/qtcreator/templates CACHE PATH "Define qtcreator template install path (default is /usr/share/qtcreator/templates)")
......
add_subdirectory(apps)
add_subdirectory(etm_usage)
add_subdirectory(mailreader)
add_subdirectory(coisceim)
set (coisceim_widget_SRCS
coisceimwidget.cpp
note.cpp
foldercontentswidget.cpp
tripwidget.cpp
createtripwidget.cpp
createfoldercontentswidget.cpp
tripmodel.cpp
stackedwidgetview.cpp
eventselectorwidget.cpp
trip.cpp
tripcomponentfactory.cpp
mixedtreemodel.cpp
itemselection.cpp
itemviewerwidget.cpp
noteviewer.cpp
todocheckableproxymodel.cpp
qmllistselectionmodel.cpp
)
set (coisceim_SRCS
main.cpp
)
set (coisceim_part_SRCS
coisceimpart.cpp
)
add_library(coisceim_widget ${coisceim_widget_SRCS})
generate_export_header(coisceim_widget BASE_NAME coisceim_widget)
qt5_generate_dbus_interface(coisceimwidget.h
org.kde.coisceim.CoisceimWidget.xml
)
qt5_add_dbus_adaptor(coisceim_widget_SRCS
${CMAKE_BINARY_DIR}/org.kde.coisceim.CoisceimWidget.xml
coisceimwidget.h
CoisceimWidget
)
target_link_libraries(coisceim_widget
KF5::AkonadiCore
KF5::AkonadiContact
KF5::CalendarCore
KF5::MessageViewer KF5::CalendarSupport KF5::AkonadiWidgets
KF5::Parts
)
set_target_properties(coisceim_widget
PROPERTIES VERSION ${KDEPIMADDONS_LIB_VERSION} SOVERSION ${KDEPIMADDONS_LIB_SOVERSION}
)
add_executable(coisceim ${coisceim_SRCS})
target_link_libraries(coisceim
coisceim_widget
)
add_library(coisceimpart MODULE ${coisceim_part_SRCS})
target_link_libraries(coisceimpart
coisceim_widget
)
install(TARGETS coisceim ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
install(TARGETS coisceim_widget ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(FILES coisceimpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install(TARGETS coisceimpart DESTINATION ${KDE_INSTALL_PLUGINDIR} )
# add_subdirectory(kontact-plugin)
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#include "coisceimpart.h"
#include <kactioncollection.h>
#include <kstandardaction.h>
#include <kpluginfactory.h>
K_PLUGIN_FACTORY(CoisceimPartFactory, registerPlugin<CoisceimPart>();
)
CoisceimPart::CoisceimPart(QWidget *parentWidget, QObject *parent, const QVariantList & /*args*/)
: KParts::ReadOnlyPart(parent)
{
setComponentName(QStringLiteral("coisce"), QStringLiteral("coisce"));
component = new CoisceimWidget(parentWidget);
setWidget(component);
}
CoisceimPart::~CoisceimPart()
{
}
#include "coisceimpart.moc"
[Desktop Entry]
Name=CoisceimPart
Name[ar]=جزء ”خطوة“
Name[ca]=Part del Coisceim
Name[ca@valencia]=Part del Coisceim
Name[da]=CoisceimPart
Name[de]=CoisceimPart
Name[en_GB]=CoisceimPart
Name[es]=CoisceimPart
Name[et]=CoisceimPart
Name[fi]=Coisceim-osa
Name[fr]=CoisceimPart
Name[gl]=CoisceimPart
Name[ia]=CoisceimPart
Name[it]=CoisceimPart
Name[ja]=CoisceimPart
Name[ko]=CoisceimPart
Name[nb]=CoisceimPart
Name[nl]=CoisceimPart
Name[pl]=Moduł Coisceim
Name[pt]=CoisceimPart
Name[pt_BR]=CoisceimPart
Name[ru]=CoisceimPart
Name[sk]=CoisceimPart
Name[sl]=CoisceimPart
Name[sr]=Кушкејм део
Name[sr@ijekavian]=Кушкејм дио
Name[sr@ijekavianlatin]=Coiscéim dio
Name[sr@latin]=Coiscéim deo
Name[sv]=Coisceim-delprogram
Name[tr]=CoisceimPart
Name[uk]=CoisceimPart
Name[x-test]=xxCoisceimPartxx
Name[zh_CN]=CoisceimPart
Name[zh_TW]=CoisceimPart
X-KDE-ServiceTypes=KParts/ReadOnlyPart
X-KDE-Library=coisceimpart
Type=Service
Icon=byobu
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#ifndef COISCEIMPART_H
#define COISCEIMPART_H
#include <kparts/part.h>
#include <kparts/statusbarextension.h>
#include <kparts/readonlypart.h>
#include "coisceimwidget.h"
class QWidget;
class KAboutData;
class CoisceimPart : public KParts::ReadOnlyPart
{
Q_OBJECT
public:
/**
* Default constructor
*/
CoisceimPart(QWidget *parentWidget, QObject *parent, const QVariantList &);
/**
* Destructor
*/
~CoisceimPart() override;
static KAboutData *createAboutData();
private:
CoisceimWidget *component;
};
#endif // COISCEIMPART_H
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#include "coisceimwidget.h"
// #include "coisceimwidgetadaptor.h"
#include <QSplitter>
#include <QListView>
#include <QTreeView>
#include <QHBoxLayout>
#include <AkonadiCore/ChangeRecorder>
#include <AkonadiCore/ItemFetchScope>
#include "tripmodel.h"
#include "stackedwidgetview.h"
#include "createtripwidget.h"
using namespace Akonadi;
CoisceimWidget::CoisceimWidget(QWidget *parent)
: QWidget(parent)
{
// new CoisceimWidgetAdaptor(this);
QHBoxLayout *layout = new QHBoxLayout(this);
QSplitter *splitter = new QSplitter;
layout->addWidget(splitter);
ChangeRecorder *tripRec = new ChangeRecorder(this);
tripRec->itemFetchScope().fetchFullPayload(true);
m_tripModel = new TripModel(tripRec, this);
QListView *list = new QListView;
list->setViewMode(QListView::IconMode);
list->setFlow(QListView::TopToBottom);
list->setUniformItemSizes(true);
list->setModel(m_tripModel);
splitter->addWidget(list);
StackedWidgetView *stack = new StackedWidgetView(TripModel::WidgetRole);
splitter->addWidget(stack);
stack->setModel(m_tripModel);
stack->setSelectionModel(list->selectionModel());
}
void CoisceimWidget::createTrip()
{
qDebug() << "CREATE";
}
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#ifndef COISCEIMWIDGET_H
#define COISCEIMWIDGET_H
#include "coisceim_widget_export.h"
#include <QWidget>
class TripModel;
class COISCEIM_WIDGET_EXPORT CoisceimWidget : public QWidget
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.coisceim.CoisceimWidget")
public:
CoisceimWidget(QWidget *parent = nullptr);
Q_INVOKABLE void createTrip();
private:
TripModel *m_tripModel;
};
#endif
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#include "createfoldercontentswidget.h"
#include "foldercontentswidget.h"
#include <QPushButton>
#include "trip.h"
#include <QIcon>
CreateFolderContentsWidget::CreateFolderContentsWidget(Trip *trip, int role, const QString &type, QWidget *parent)
: QStackedWidget(parent)
, m_trip(trip)
, m_role(role)
{
QPushButton *button = new QPushButton(QLatin1String("Select ") + type);
QString iconName;
switch (role) {
case Trip::MailCollectionRole:
iconName = QStringLiteral("kmail");
break;
case Trip::NotesCollectionRole:
iconName = QStringLiteral("knotes");
break;
case Trip::TodoCollectionRole:
iconName = QStringLiteral("korg-todo");
break;
}
QIcon icon = QIcon::fromTheme(iconName);
button->setIcon(icon);
button->setIconSize(QSize(128, 128));
addWidget(button);
m_widget = new FolderContentsWidget(trip, role, type);
addWidget(m_widget);
connect(button, &QPushButton::clicked, m_widget, &FolderContentsWidget::configure);
connect(m_trip, &Trip::monitoredCollectionsChanged, this, &CreateFolderContentsWidget::collectionSelected);
}
void CreateFolderContentsWidget::collectionSelected()
{
setCurrentIndex(m_trip->collection(m_role).isValid() ? 1 : 0);
}
void CreateFolderContentsWidget::clear()
{
// m_widget->clear();
}
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#ifndef CREATEFOLDERCONTENTSWIDGET_H
#define CREATEFOLDERCONTENTSWIDGET_H
#include <QStackedWidget>
#include <AkonadiCore/Collection>
class FolderContentsWidget;
class Trip;
class CreateFolderContentsWidget : public QStackedWidget
{
Q_OBJECT
public:
explicit CreateFolderContentsWidget(Trip *trip, int role, const QString &type, QWidget *parent = nullptr);
void clear();
private Q_SLOTS:
void collectionSelected();
private:
FolderContentsWidget *m_widget;
Trip *m_trip;
int m_role;
};
#endif
/*
This file is part of Akonadi.
Copyright (c) 2011 Stephen Kelly <steveire@gmail.com>
This program 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.
This program 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.
*/
#include "createtripwidget.h"
#include <QVBoxLayout>
#include <QPushButton>
#include <kconfig.h>
#include <KMessageBox>
#include <KLocalizedString>
#include <KConfig>
#include <KConfigGroup>
#include <KSharedConfig>
#include <AkonadiCore/Monitor>
#include "createfoldercontentswidget.h"
#include "eventselectorwidget.h"
#include "trip.h"
using namespace Akonadi;
CreateTripWidget::CreateTripWidget(Trip *trip, Akonadi::Monitor *monitor, QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
, m_trip(trip)
, m_monitor(monitor)
{
QVBoxLayout *layout = new QVBoxLayout(this);
m_eventSelector = new EventSelectorWidget;
connect(m_eventSelector, &EventSelectorWidget::selected, this, &CreateTripWidget::tripSelected);
layout->addWidget(m_eventSelector);
QHBoxLayout *configureLayout = new QHBoxLayout;
layout->addLayout(configureLayout);
m_mailWidget = createView(QStringLiteral("Mail"), Trip::MailCollectionRole);
m_todoWidget = createView(QStringLiteral("Todos"), Trip::TodoCollectionRole);
m_notesWidget = createView(QStringLiteral("Notes"), Trip::NotesCollectionRole);
configureLayout->addWidget(m_mailWidget);
configureLayout->addWidget(m_todoWidget);
configureLayout->addWidget(m_notesWidget);
QPushButton *goButton = new QPushButton(i18n("Go!"));
connect(goButton, &QPushButton::clicked, this, &CreateTripWidget::create);
layout->addWidget(goButton);
}
CreateFolderContentsWidget *CreateTripWidget::createView(const QString &type, int role)
{
return new CreateFolderContentsWidget(m_trip, role, type);
}
void CreateTripWidget::tripSelected(const Akonadi::Item &item)
{
m_tripItem = item;
}
void addTrip(QVariantList *list, Item::Id newId)
{
bool found = false;
for (const QVariant &id : qAsConst(*list)) {
if (id.toLongLong() == newId) {
found = true;
}
}
if (!found) {
list->append(newId);
}
}
void CreateTripWidget::create()
{
if (!m_tripItem.isValid()) {
KMessageBox::error(this, i18n("You need to select an event first"));
return;
}
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup generalGroup(config, "General");
QVariantList trips = generalGroup.readEntry<QVariantList>("trips", QVariantList());
addTrip(&trips, m_tripItem.id());
generalGroup.writeEntry("trips", trips);
KConfigGroup tripsGroup(config, "Trips");
QList<Collection::Id> ids;
ids << m_trip->collection(Trip::MailCollectionRole).id();
ids << m_trip->collection(Trip::TodoCollectionRole).id();
ids << m_trip->collection(Trip::NotesCollectionRole).id();
tripsGroup.writeEntry(QString::number(m_tripItem.id()), ids);
config->sync();
m_monitor->setItemMonitored(m_tripItem, true);
m_trip->setCollection(Trip::MailCollectionRole, Collection());
m_trip->setCollection(Trip::TodoCollectionRole, Collection());
m_trip->setCollection(Trip::NotesCollectionRole, Collection());
m_eventSelector->clear();
m_tripItem = Item();
}