Commit fcd20a2e authored by Laurent Montel's avatar Laurent Montel 😁

Port++

parent 15e37364
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include <KToggleAction> #include <KToggleAction>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <KActionMenu> #include <KActionMenu>
#include <KAction> #include <QAction>
#include <kconfigdialog.h> #include <kconfigdialog.h>
#include <qdebug.h> #include <qdebug.h>
#include <kmessagebox.h> #include <kmessagebox.h>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
#include <KSelectAction> #include <KSelectAction>
#include <kimagefilepreview.h> #include <kimagefilepreview.h>
#include <KToolInvocation> #include <KToolInvocation>
#include <KMenu> #include <QMenu>
#include <QDockWidget> #include <QDockWidget>
#include <QProgressBar> #include <QProgressBar>
...@@ -211,24 +211,24 @@ void MainWindow::setupActions() ...@@ -211,24 +211,24 @@ void MainWindow::setupActions()
KStandardAction::preferences( this, SLOT(optionsPreferences()), actionCollection() ); KStandardAction::preferences( this, SLOT(optionsPreferences()), actionCollection() );
// custom menu and menu item // custom menu and menu item
KAction *actNewPost = new KAction( QIcon::fromTheme( QLatin1String("document-new") ), i18n( "New Post" ), this ); QAction *actNewPost = new QAction( QIcon::fromTheme( QLatin1String("document-new") ), i18n( "New Post" ), this );
actionCollection()->addAction( QLatin1String( "new_post" ), actNewPost ); actionCollection()->addAction( QLatin1String( "new_post" ), actNewPost );
actNewPost->setShortcut( Qt::CTRL + Qt::Key_N ); actNewPost->setShortcut( Qt::CTRL + Qt::Key_N );
connect( actNewPost, SIGNAL(triggered(bool)), this, SLOT(slotCreateNewPost()) ); connect( actNewPost, SIGNAL(triggered(bool)), this, SLOT(slotCreateNewPost()) );
KAction *actAddBlog = new KAction( QIcon::fromTheme( QLatin1String("list-add") ), i18n( "Add Blog..." ), this ); QAction *actAddBlog = new QAction( QIcon::fromTheme( QLatin1String("list-add") ), i18n( "Add Blog..." ), this );
actionCollection()->addAction( QLatin1String( "add_blog" ), actAddBlog ); actionCollection()->addAction( QLatin1String( "add_blog" ), actAddBlog );
connect( actAddBlog, SIGNAL(triggered(bool)), this, SLOT(addBlog()) ); connect( actAddBlog, SIGNAL(triggered(bool)), this, SLOT(addBlog()) );
KAction *actPublish = new KAction( QIcon::fromTheme( QLatin1String("arrow-up") ), i18n( "Submit..." ), this ); QAction *actPublish = new QAction( QIcon::fromTheme( QLatin1String("arrow-up") ), i18n( "Submit..." ), this );
actionCollection()->addAction( QLatin1String( "publish_post" ), actPublish ); actionCollection()->addAction( QLatin1String( "publish_post" ), actPublish );
connect( actPublish, SIGNAL(triggered(bool)), this, SLOT(slotPublishPost()) ); connect( actPublish, SIGNAL(triggered(bool)), this, SLOT(slotPublishPost()) );
KAction *actUpload = new KAction( QIcon::fromTheme( QLatin1String("upload-media") ), i18n( "Upload Media..." ), this ); QAction *actUpload = new QAction( QIcon::fromTheme( QLatin1String("upload-media") ), i18n( "Upload Media..." ), this );
actionCollection()->addAction( QLatin1String( "upload_media" ), actUpload ); actionCollection()->addAction( QLatin1String( "upload_media" ), actUpload );
connect( actUpload, SIGNAL(triggered(bool)), this, SLOT(uploadMediaObject()) ); connect( actUpload, SIGNAL(triggered(bool)), this, SLOT(uploadMediaObject()) );
KAction *actSaveLocally = new KAction( QIcon::fromTheme( QLatin1String("document-save") ), i18n( "Save Locally" ), this ); QAction *actSaveLocally = new QAction( QIcon::fromTheme( QLatin1String("document-save") ), i18n( "Save Locally" ), this );
actionCollection()->addAction( QLatin1String( "save_locally" ), actSaveLocally ); actionCollection()->addAction( QLatin1String( "save_locally" ), actSaveLocally );
actSaveLocally->setShortcut( Qt::CTRL + Qt::Key_S ); actSaveLocally->setShortcut( Qt::CTRL + Qt::Key_S );
connect( actSaveLocally, SIGNAL(triggered(bool)), this, SLOT(slotSavePostLocally()) ); connect( actSaveLocally, SIGNAL(triggered(bool)), this, SLOT(slotSavePostLocally()) );
...@@ -244,7 +244,7 @@ void MainWindow::setupActions() ...@@ -244,7 +244,7 @@ void MainWindow::setupActions()
blogs = new KSelectAction( this ); blogs = new KSelectAction( this );
actionCollection()->addAction( QLatin1String( "blogs_list" ), blogs ); actionCollection()->addAction( QLatin1String( "blogs_list" ), blogs );
KAction *actOpenBlog = new KAction(QIcon::fromTheme(QLatin1String("applications-internet")), i18n("Open in browser"), this); QAction *actOpenBlog = new QAction(QIcon::fromTheme(QLatin1String("applications-internet")), i18n("Open in browser"), this);
actionCollection()->addAction( QLatin1String("open_blog_in_browser"), actOpenBlog); actionCollection()->addAction( QLatin1String("open_blog_in_browser"), actOpenBlog);
actOpenBlog->setToolTip(i18n("Open current blog in browser")); actOpenBlog->setToolTip(i18n("Open current blog in browser"));
connect( actOpenBlog, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentBlogInBrowser()) ); connect( actOpenBlog, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentBlogInBrowser()) );
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <KLocale> #include <KLocale>
#include <QIcon> #include <QIcon>
#include <KMenu> #include <QMenu>
#include <QToolButton> #include <QToolButton>
#include <QTabBar> #include <QTabBar>
...@@ -72,7 +72,7 @@ void PostsTabWidget::slotTabContextMenuRequest( const QPoint &pos ) ...@@ -72,7 +72,7 @@ void PostsTabWidget::slotTabContextMenuRequest( const QPoint &pos )
if ( indexBar == -1 ) if ( indexBar == -1 )
return; return;
KMenu menu( this ); QMenu menu( this );
QAction *closeTab = menu.addAction( i18nc( "@action:inmenu", "Close Tab" ) ); QAction *closeTab = menu.addAction( i18nc( "@action:inmenu", "Close Tab" ) );
closeTab->setIcon( QIcon::fromTheme( QLatin1String( "tab-close" ) ) ); closeTab->setIcon( QIcon::fromTheme( QLatin1String( "tab-close" ) ) );
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
#include "catcheckbox.h" #include "catcheckbox.h"
#include "settings.h" #include "settings.h"
#include <KMenu> #include <QMenu>
#include <QIcon> #include <QIcon>
#include <KAction> #include <QAction>
#include <KToolInvocation> #include <KToolInvocation>
#include <QClipboard> #include <QClipboard>
#include <QTimer> #include <QTimer>
...@@ -492,14 +492,14 @@ void Toolbox::requestEntriesListContextMenu( const QPoint & pos ) ...@@ -492,14 +492,14 @@ void Toolbox::requestEntriesListContextMenu( const QPoint & pos )
if ( lstEntriesList->selectedItems().isEmpty() ) if ( lstEntriesList->selectedItems().isEmpty() )
return; return;
Q_UNUSED(pos); Q_UNUSED(pos);
KMenu *entriesContextMenu = new KMenu; QMenu *entriesContextMenu = new QMenu;
KAction *actEntriesOpenInBrowser = new KAction( QIcon::fromTheme(QLatin1String("applications-internet")), QAction *actEntriesOpenInBrowser = new QAction( QIcon::fromTheme(QLatin1String("applications-internet")),
i18n("Open in browser"), entriesContextMenu ); i18n("Open in browser"), entriesContextMenu );
connect( actEntriesOpenInBrowser, SIGNAL(triggered()), this, SLOT(openPostInBrowser()) ); connect( actEntriesOpenInBrowser, SIGNAL(triggered()), this, SLOT(openPostInBrowser()) );
KAction *actEntriesCopyUrl = new KAction( QIcon::fromTheme(QLatin1String("edit-copy")), QAction *actEntriesCopyUrl = new QAction( QIcon::fromTheme(QLatin1String("edit-copy")),
i18n("Copy URL"), entriesContextMenu ); i18n("Copy URL"), entriesContextMenu );
connect( actEntriesCopyUrl, SIGNAL(triggered(bool)), this, SLOT(slotEntriesCopyUrl()) ); connect( actEntriesCopyUrl, SIGNAL(triggered(bool)), this, SLOT(slotEntriesCopyUrl()) );
KAction *actEntriesCopyTitle = new KAction( QIcon::fromTheme(QLatin1String("edit-copy")), QAction *actEntriesCopyTitle = new QAction( QIcon::fromTheme(QLatin1String("edit-copy")),
i18n("Copy title"), entriesContextMenu ); i18n("Copy title"), entriesContextMenu );
connect( actEntriesCopyTitle, SIGNAL(triggered(bool)), this, SLOT(copyPostTitle()) ); connect( actEntriesCopyTitle, SIGNAL(triggered(bool)), this, SLOT(copyPostTitle()) );
entriesContextMenu->addAction( actEntriesOpenInBrowser ); entriesContextMenu->addAction( actEntriesOpenInBrowser );
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <qdebug.h> #include <qdebug.h>
#include <KMessageBox> #include <KMessageBox>
#include <KHelpMenu> #include <KHelpMenu>
#include <KMenu> #include <QMenu>
#include <AkonadiCore/control.h> #include <AkonadiCore/control.h>
#include <mailcommon/kernel/mailkernel.h> #include <mailcommon/kernel/mailkernel.h>
......
...@@ -3,7 +3,7 @@ project(kgpgconf) ...@@ -3,7 +3,7 @@ project(kgpgconf)
include_directories(${CMAKE_SOURCE_DIR}/libkleo/backends/qgpgme) include_directories(${CMAKE_SOURCE_DIR}/libkleo/backends/qgpgme)
add_definitions(-D_ASSUAN_ONLY_GPG_ERRORS -DKDE_DEFAULT_DEBUG_AREA=5154) add_definitions(-D_ASSUAN_ONLY_GPG_ERRORS -DKDE_DEFAULT_DEBUG_AREA=5154)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") kde_enable_exceptions()
set(_kgpgconf_SRCS set(_kgpgconf_SRCS
configreader.cpp configreader.cpp
...@@ -14,13 +14,13 @@ set(_kgpgconf_SRCS ...@@ -14,13 +14,13 @@ set(_kgpgconf_SRCS
mainwindow.cpp mainwindow.cpp
) )
kde4_add_ui_files(_kgpgconf_SRCS mainwidget.ui) qt5_wrap_ui(_kgpgconf_SRCS mainwidget.ui)
# todo: more appropriate icon? # todo: more appropriate icon?
kde4_add_app_icon(_kgpgconf_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/preferences-desktop-cryptography.png") kde4_add_app_icon(_kgpgconf_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/preferences-desktop-cryptography.png")
kde4_add_executable(kgpgconf ${_kgpgconf_SRCS}) add_executable(kgpgconf ${_kgpgconf_SRCS})
target_link_libraries(kgpgconf ${QGPGME_LIBRARIES} ${KDE4_KDEUI_LIBS}) target_link_libraries(kgpgconf ${QGPGME_LIBRARIES} Qt5::Core KF5::KDELibs4Support )
install(TARGETS kgpgconf ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kgpgconf ${INSTALL_TARGETS_DEFAULT_ARGS})
...@@ -1210,17 +1210,17 @@ void AddresseeLineEdit::dropEvent( QDropEvent *event ) ...@@ -1210,17 +1210,17 @@ void AddresseeLineEdit::dropEvent( QDropEvent *event )
return; return;
} }
} else { } else {
//QT5
#if 0
// Let's see if this drop contains a comma separated list of emails // Let's see if this drop contains a comma separated list of emails
const QString dropData = QString::fromUtf8( event->encodedData( "text/plain" ) ); const QMimeData *mimeData = event->mimeData();
if (mimeData->hasText() ) {
const QString dropData = mimeData->text();
const QStringList addrs = KPIMUtils::splitAddressList( dropData ); const QStringList addrs = KPIMUtils::splitAddressList( dropData );
if ( !addrs.isEmpty() ) { if ( !addrs.isEmpty() ) {
setText( KPIMUtils::normalizeAddressesAndDecodeIdn( dropData ) ); setText( KPIMUtils::normalizeAddressesAndDecodeIdn( dropData ) );
setModified( true ); setModified( true );
return; return;
} }
#endif }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment