Commit ba2be5c6 authored by Kurt Hindenburg's avatar Kurt Hindenburg

uncrustify using kf5 config

parent b7676178
This diff is collapsed.
......@@ -34,8 +34,7 @@ class QAction;
class KActionMenu;
class KToggleAction;
namespace Konsole
{
namespace Konsole {
class IncrementalSearchBar;
class ViewManager;
class ViewProperties;
......@@ -69,7 +68,7 @@ public:
* Returns the view manager associated with this window. The view manager can be used to
* create new views on particular session objects inside this window.
*/
ViewManager* viewManager() const;
ViewManager *viewManager() const;
/**
* Create a new session.
......@@ -78,7 +77,7 @@ public:
* @param directory Initial working directory for the new session or empty
* if the default working directory associated with the profile should be used.
*/
Session* createSession(Profile::Ptr profile, const QString& directory);
Session *createSession(Profile::Ptr profile, const QString &directory);
/**
* create a new SSH session.
......@@ -86,12 +85,12 @@ public:
* @param profile The profile to use to create the new session.
* @param url the URL representing the new SSH connection
*/
Session* createSSHSession(Profile::Ptr profile, const QUrl& url);
Session *createSSHSession(Profile::Ptr profile, const QUrl &url);
/**
* create view for the specified session
*/
void createView(Session* session);
void createView(Session *session);
/**
* Helper method to make this window get input focus
......@@ -105,8 +104,8 @@ public:
void setNavigationVisibility(int visibility);
void setNavigationPosition(int position);
void setNavigationStyleSheet(const QString& stylesheet);
void setNavigationStyleSheetFromFile(const QUrl& stylesheetfile);
void setNavigationStyleSheet(const QString &stylesheet);
void setNavigationStyleSheetFromFile(const QUrl &stylesheetfile);
void setNavigationBehavior(int behavior);
void setShowQuickButtons(bool show);
......@@ -122,24 +121,23 @@ Q_SIGNALS:
* if the default working directory associated with the profile should
* be used.
*/
void newWindowRequest(Profile::Ptr profile,
const QString& directory);
void newWindowRequest(Profile::Ptr profile, const QString &directory);
/**
* Emitted when a view for one session is detached from this window
*/
void viewDetached(Session* session);
void viewDetached(Session *session);
protected:
// Reimplemented for internal reasons.
void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
// reimplemented from KMainWindow
bool queryClose() Q_DECL_OVERRIDE;
void saveProperties(KConfigGroup& group) Q_DECL_OVERRIDE;
void readProperties(const KConfigGroup& group) Q_DECL_OVERRIDE;
void saveGlobalProperties(KConfig* config) Q_DECL_OVERRIDE;
void readGlobalProperties(KConfig* config) Q_DECL_OVERRIDE;
void saveProperties(KConfigGroup &group) Q_DECL_OVERRIDE;
void readProperties(const KConfigGroup &group) Q_DECL_OVERRIDE;
void saveGlobalProperties(KConfig *config) Q_DECL_OVERRIDE;
void readGlobalProperties(KConfig *config) Q_DECL_OVERRIDE;
// reimplemented from QWidget
bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
......@@ -153,19 +151,19 @@ private Q_SLOTS:
void showSettingsDialog(const bool showProfilePage = false);
void showShortcutsDialog();
void newFromProfile(Profile::Ptr profile);
void activeViewChanged(SessionController* controller);
void disconnectController(SessionController* controller);
void activeViewTitleChanged(ViewProperties*);
void activeViewChanged(SessionController *controller);
void disconnectController(SessionController *controller);
void activeViewTitleChanged(ViewProperties *);
void profileListChanged(const QList<QAction*>& actions);
void profileListChanged(const QList<QAction *> &actions);
void configureNotifications();
void updateWindowIcon();
void updateWindowCaption();
void openUrls(const QList<QUrl>& urls);
void openUrls(const QList<QUrl> &urls);
// Sets the list of profiles to be displayed under the "New Tab" action
void setProfileList(ProfileList* list);
void setProfileList(ProfileList *list);
void applyKonsoleSettings();
......@@ -189,22 +187,22 @@ private:
* This is a convenience method. The search bar is actually owned by
* ViewManager, or more precisely, by ViewContainer.
*/
IncrementalSearchBar* searchBar() const;
IncrementalSearchBar *searchBar() const;
/**
* Returns the bookmark handler associated with this window.
*/
BookmarkHandler* bookmarkHandler() const;
BookmarkHandler *bookmarkHandler() const;
// sets the active shortcuts of actions in 'dest' to the shortcuts of actions
// with the same name in 'source' (see QAction::ActiveShortcut)
static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
static void syncActiveShortcuts(KActionCollection *dest, const KActionCollection *source);
private:
ViewManager* _viewManager;
BookmarkHandler* _bookmarkHandler;
KToggleAction* _toggleMenuBarAction;
KActionMenu* _newTabMenuAction;
ViewManager *_viewManager;
BookmarkHandler *_bookmarkHandler;
KToggleAction *_toggleMenuBarAction;
KActionMenu *_newTabMenuAction;
QPointer<SessionController> _pluggedController;
......
......@@ -40,14 +40,14 @@
using Konsole::Application;
// fill the KAboutData structure with information about contributors to Konsole.
void fillAboutData(KAboutData& aboutData);
void fillAboutData(KAboutData &aboutData);
// check and report whether this konsole instance should use a new konsole
// process, or re-use an existing konsole process.
bool shouldUseNewProcess(int argc, char *argv[]);
// restore sessions saved by KDE.
void restoreSession(Application& app);
void restoreSession(Application &app);
// Workaround for a bug in KDBusService: https://bugs.kde.org/show_bug.cgi?id=355545
// It calls exit(), but the program can't exit before the QApplication is deleted:
......@@ -63,7 +63,7 @@ void deleteQApplication()
// ***
// Entry point into the Konsole terminal application.
// ***
extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
extern "C" int Q_DECL_EXPORT kdemain(int argc, char *argv[])
{
// Check if any of the arguments makes it impossible to re-use an existing process.
// We need to do this manually and before creating a QApplication, because
......@@ -122,7 +122,8 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
about.processCommandLine(parser.data());
// Enable user to force multiple instances, unless a new tab is requested
if (!Konsole::KonsoleSettings::useSingleInstance() && !parser->isSet(QStringLiteral("new-tab"))) {
if (!Konsole::KonsoleSettings::useSingleInstance()
&& !parser->isSet(QStringLiteral("new-tab"))) {
startupOption = KDBusService::Multiple;
}
......@@ -134,7 +135,8 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
needToDeleteQApplication = false;
Kdelibs4ConfigMigrator migrate(QStringLiteral("konsole"));
migrate.setConfigFiles(QStringList() << QStringLiteral("konsolerc") << QStringLiteral("konsole.notifyrc"));
migrate.setConfigFiles(QStringList() << QStringLiteral("konsolerc")
<< QStringLiteral("konsole.notifyrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("sessionui.rc") << QStringLiteral("partui.rc") << QStringLiteral("konsoleui.rc"));
if (migrate.migrate()) {
......@@ -146,14 +148,15 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
QDir sourceDir(sourceBasePath);
QDir targetDir(targetBasePath);
if(sourceDir.exists()) {
if(!targetDir.exists()) {
if (sourceDir.exists()) {
if (!targetDir.exists()) {
QDir().mkpath(targetBasePath);
}
QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks);
QStringList fileNames = sourceDir.entryList(
QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks);
foreach (const QString &fileName, fileNames) {
targetFilePath = targetBasePath + fileName;
if(!QFile::exists(targetFilePath)) {
if (!QFile::exists(targetFilePath)) {
QFile::copy(sourceBasePath + fileName, targetFilePath);
}
}
......@@ -166,7 +169,8 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
// The activateRequested() signal is emitted when a second instance
// of Konsole is started.
QObject::connect(&dbusService, &KDBusService::activateRequested, &konsoleApp, &Application::slotActivateRequested);
QObject::connect(&dbusService, &KDBusService::activateRequested, &konsoleApp,
&Application::slotActivateRequested);
if (app->isSessionRestored()) {
restoreSession(konsoleApp);
......@@ -199,14 +203,14 @@ bool shouldUseNewProcess(int argc, char *argv[])
// We need to manually parse the arguments because QApplication removes the
// Qt specific arguments (like --reverse)
QStringList arguments;
for (int i=0; i < argc; i++) {
for (int i = 0; i < argc; i++) {
arguments.append(QString::fromLocal8Bit(argv[i]));
}
// take Qt options into consideration
QStringList qtProblematicOptions;
qtProblematicOptions << QStringLiteral("--session")
<< QStringLiteral("--name")
qtProblematicOptions << QStringLiteral("--session")
<< QStringLiteral("--name")
<< QStringLiteral("--reverse")
<< QStringLiteral("--stylesheet")
<< QStringLiteral("--graphicssystem");
......@@ -214,7 +218,7 @@ bool shouldUseNewProcess(int argc, char *argv[])
qtProblematicOptions << QStringLiteral("--display")
<< QStringLiteral("--visual");
#endif
foreach(const QString& option, qtProblematicOptions) {
foreach (const QString &option, qtProblematicOptions) {
if (arguments.contains(option)) {
return true;
}
......@@ -228,7 +232,7 @@ bool shouldUseNewProcess(int argc, char *argv[])
kdeProblematicOptions << QStringLiteral("--waitforwm");
#endif
foreach(const QString& option, kdeProblematicOptions) {
foreach (const QString &option, kdeProblematicOptions) {
if (arguments.contains(option)) {
return true;
}
......@@ -237,8 +241,8 @@ bool shouldUseNewProcess(int argc, char *argv[])
// if users have explictly requested starting a new process
// Support --nofork to retain argument compatibility with older
// versions.
if (arguments.contains(QStringLiteral("--separate")) ||
arguments.contains(QStringLiteral("--nofork"))) {
if (arguments.contains(QStringLiteral("--separate"))
|| arguments.contains(QStringLiteral("--nofork"))) {
return true;
}
......@@ -261,14 +265,14 @@ bool shouldUseNewProcess(int argc, char *argv[])
return hasControllingTTY;
}
void fillAboutData(KAboutData& aboutData)
void fillAboutData(KAboutData &aboutData)
{
aboutData.setProgramIconName(QStringLiteral("utilities-terminal"));
aboutData.setOrganizationDomain("kde.org");
aboutData.addAuthor(i18nc("@info:credit", "Kurt Hindenburg"),
i18nc("@info:credit", "General maintainer, bug fixes and general"
" improvements"),
" improvements"),
QStringLiteral("kurt.hindenburg@gmail.com"));
aboutData.addAuthor(i18nc("@info:credit", "Robert Knight"),
i18nc("@info:credit", "Previous maintainer, ported to KDE4"),
......@@ -305,18 +309,18 @@ void fillAboutData(KAboutData& aboutData)
QStringLiteral("Peter.A.Silva@gmail.com"));
aboutData.addCredit(i18nc("@info:credit", "Lotzi Boloni"),
i18nc("@info:credit", "Embedded Konsole\n"
"Toolbar and session names"),
"Toolbar and session names"),
QStringLiteral("boloni@cs.purdue.edu"));
aboutData.addCredit(i18nc("@info:credit", "David Faure"),
i18nc("@info:credit", "Embedded Konsole\n"
"General improvements"),
"General improvements"),
QStringLiteral("faure@kde.org"));
aboutData.addCredit(i18nc("@info:credit", "Antonio Larrosa"),
i18nc("@info:credit", "Visual effects"),
QStringLiteral("larrosa@kde.org"));
aboutData.addCredit(i18nc("@info:credit", "Matthias Ettrich"),
i18nc("@info:credit", "Code from the kvt project\n"
"General improvements"),
"General improvements"),
QStringLiteral("ettrich@kde.org"));
aboutData.addCredit(i18nc("@info:credit", "Warwick Allison"),
i18nc("@info:credit", "Schema and text selection improvements"),
......@@ -342,10 +346,10 @@ void fillAboutData(KAboutData& aboutData)
aboutData.addCredit(i18nc("@info:credit", "Thanks to many others.\n"));
}
void restoreSession(Application& app)
void restoreSession(Application &app)
{
int n = 1;
while (KMainWindow::canBeRestored(n))
while (KMainWindow::canBeRestored(n)) {
app.newMainWindow()->restore(n++);
}
}
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