Commit 0478529c authored by Tomaz  Canabrava's avatar Tomaz Canabrava

Move Profile related classes to it's own folder

This also allowed me to remove a few includes of Profile.h
around the codebase, that used Profile::Ptr. now the compilation
is a bit faster and also does not recompile things as often.
parent df196438
......@@ -34,16 +34,16 @@
#include <KLocalizedString>
// Konsole
#include "session/SessionManager.h"
#include "ProfileManager.h"
#include "KonsoleSettings.h"
#include "MainWindow.h"
#include "session/Session.h"
#include "ShellCommand.h"
#include "KonsoleSettings.h"
#include "ViewManager.h"
#include "WindowSystemInfo.h"
#include "widgets/ViewContainer.h"
#include "profile/ProfileManager.h"
#include "session/Session.h"
#include "session/SessionManager.h"
#include "widgets/TerminalDisplay.h"
#include "widgets/ViewContainer.h"
using namespace Konsole;
......
......@@ -24,12 +24,12 @@
#include <QCommandLineParser>
// Konsole
#include "Profile.h"
#include "widgets/ViewSplitter.h"
namespace Konsole {
class MainWindow;
class Session;
class Profile;
/**
* The Konsole Application.
......@@ -68,7 +68,7 @@ public:
MainWindow *newMainWindow();
private Q_SLOTS:
void createWindow(const Profile::Ptr &profile, const QString &directory);
void createWindow(const QExplicitlySharedDataPointer<Profile> &profile, const QString &directory);
void detachTerminals(ViewSplitter *splitter, const QHash<TerminalDisplay*, Session*>& sessionsMap);
void toggleBackgroundInstance();
......@@ -84,8 +84,8 @@ private:
void startBackgroundMode(MainWindow *window);
bool processHelpArgs();
MainWindow *processWindowArgs(bool &createdNewMainWindow);
Profile::Ptr processProfileSelectArgs();
Profile::Ptr processProfileChangeArgs(Profile::Ptr baseProfile);
QExplicitlySharedDataPointer<Profile> processProfileSelectArgs();
QExplicitlySharedDataPointer<Profile> processProfileChangeArgs(QExplicitlySharedDataPointer<Profile> baseProfile);
bool processTabsFromFileArgs(MainWindow *window);
void createTabFromArgs(MainWindow *window, const QHash<QString, QString> &);
void finalizeNewMainWindow(MainWindow *window);
......
......@@ -60,7 +60,12 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
ColorSchemeEditor.cpp
CopyInputDialog.cpp
CheckableSessionModel.cpp
EditProfileDialog.cpp
profile/EditProfileDialog.cpp
profile/Profile.cpp
profile/ProfileList.cpp
profile/ProfileReader.cpp
profile/ProfileWriter.cpp
profile/ProfileManager.cpp
ColorSchemeViewDelegate.cpp
LabelsAligner.cpp
FontDialog.cpp
......@@ -102,11 +107,6 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
NullProcessInfo.cpp
UnixProcessInfo.cpp
SSHProcessInfo.cpp
Profile.cpp
ProfileList.cpp
ProfileReader.cpp
ProfileWriter.cpp
ProfileManager.cpp
Pty.cpp
RenameTabDialog.cpp
widgets/RenameTabWidget.cpp
......@@ -148,40 +148,17 @@ ecm_qt_declare_logging_category(konsoleprivate_SRCS HEADER konsoledebug.h IDENTI
kconfig_add_kcfg_files(konsoleprivate_SRCS settings/KonsoleSettings.kcfgc)
set(konsole_LIBS
KF5::XmlGui
Qt5::PrintSupport
Qt5::Xml
KF5::Notifications
KF5::WindowSystem
KF5::TextWidgets
KF5::GuiAddons
KF5::IconThemes
KF5::Bookmarks
KF5::I18n
KF5::Pty
KF5::KIOWidgets
KF5::DBusAddons
KF5::GlobalAccel
KF5::NewStuff
)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
#kinfo_getfile() is in libutil
list(APPEND konsole_LIBS util)
endif()
### Konsole Application
ki18n_wrap_ui(konsoleprivate_SRCS ColorSchemeEditor.ui
CopyInputDialog.ui
EditProfileGeneralPage.ui
EditProfileTabsPage.ui
EditProfileAppearancePage.ui
EditProfileScrollingPage.ui
EditProfileKeyboardPage.ui
EditProfileMousePage.ui
EditProfileAdvancedPage.ui
profile/EditProfileGeneralPage.ui
profile/EditProfileTabsPage.ui
profile/EditProfileAppearancePage.ui
profile/EditProfileScrollingPage.ui
profile/EditProfileKeyboardPage.ui
profile/EditProfileMousePage.ui
profile/EditProfileAdvancedPage.ui
KeyBindingEditor.ui
RenameTabDialog.ui
widgets/RenameTabWidget.ui
......
......@@ -26,8 +26,7 @@
// KDE
#include <QDialog>
// Konsole
#include "Profile.h"
#include "konsoleprivate_export.h"
class QTableWidgetItem;
......
......@@ -31,11 +31,12 @@
// Konsole
#include "ui_KeyBindingEditor.h"
#include "EditProfileDialog.h"
#include "KeyboardTranslator.h"
#include "KeyboardTranslatorReader.h"
#include "KeyboardTranslatorManager.h"
#include "profile/EditProfileDialog.h"
using namespace Konsole;
KeyBindingEditor::KeyBindingEditor(QWidget *parent) :
......
......@@ -24,7 +24,8 @@
#include <QDialog>
// Konsole
#include "Profile.h"
//TODO: Move away Profile::Property from the profile header.
#include "profile/Profile.h"
class QTableWidgetItem;
......
......@@ -43,23 +43,27 @@
// Konsole
#include "BookmarkHandler.h"
#include "session/SessionController.h"
#include "ProfileList.h"
#include "session/Session.h"
#include "widgets/ViewContainer.h"
#include "ViewManager.h"
#include "session/SessionManager.h"
#include "ProfileManager.h"
#include "KonsoleSettings.h"
#include "ViewManager.h"
#include "WindowSystemInfo.h"
#include "widgets/TerminalDisplay.h"
#include "profile/ProfileList.h"
#include "profile/ProfileManager.h"
#include "session/Session.h"
#include "session/SessionController.h"
#include "session/SessionManager.h"
#include "settings/ConfigurationDialog.h"
#include "settings/TemporaryFilesSettings.h"
#include "settings/GeneralSettings.h"
#include "settings/ProfileSettings.h"
#include "settings/TabBarSettings.h"
#include "settings/TemporaryFilesSettings.h"
#include "settings/ThumbnailsSettings.h"
#include "widgets/TerminalDisplay.h"
#include "widgets/ViewContainer.h"
using namespace Konsole;
MainWindow::MainWindow() :
......
......@@ -23,12 +23,12 @@
// Qt
#include <QPointer>
#include <QUrl>
#include <QExplicitlySharedDataPointer>
// KDE
#include <KXmlGuiWindow>
// Konsole
#include "Profile.h"
#include "widgets/ViewSplitter.h"
class QAction;
......@@ -40,6 +40,7 @@ class ViewManager;
class ViewProperties;
class Session;
class SessionController;
class Profile;
class ProfileList;
class BookmarkHandler;
......@@ -77,7 +78,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(QExplicitlySharedDataPointer<Profile> profile, const QString &directory);
/**
* create a new SSH session.
......@@ -85,7 +86,7 @@ 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(QExplicitlySharedDataPointer<Profile> profile , const QUrl &url);
/**
* Helper method to make this window get input focus
......@@ -117,7 +118,7 @@ Q_SIGNALS:
* if the default working directory associated with the profile should
* be used.
*/
void newWindowRequest(const Profile::Ptr &profile, const QString &directory);
void newWindowRequest(const QExplicitlySharedDataPointer<Profile> &profile, const QString &directory);
/**
* Emitted when a view for one session is detached from this window
......@@ -147,7 +148,7 @@ private Q_SLOTS:
void activateMenuBar();
void showSettingsDialog(bool showProfilePage = false);
void showShortcutsDialog();
void newFromProfile(const Profile::Ptr &profile);
void newFromProfile(const QExplicitlySharedDataPointer<Profile> &profile);
void activeViewChanged(SessionController *controller);
void disconnectController(SessionController *controller);
void activeViewTitleChanged(ViewProperties *);
......
......@@ -35,18 +35,18 @@
#include <KConfigDialog>
// Konsole
#include "EditProfileDialog.h"
#include "Emulation.h"
#include "KonsoleSettings.h"
#include "ViewManager.h"
#include "profile/EditProfileDialog.h"
#include "profile/ProfileManager.h"
#include "session/Session.h"
#include "session/SessionController.h"
#include "session/SessionManager.h"
#include "ProfileManager.h"
#include "widgets/TerminalDisplay.h"
#include "ViewManager.h"
#include "widgets/ViewContainer.h"
#include "KonsoleSettings.h"
#include "settings/PartInfo.h"
#include "settings/ProfileSettings.h"
#include "widgets/TerminalDisplay.h"
#include "widgets/ViewContainer.h"
using namespace Konsole;
......@@ -111,7 +111,7 @@ Session *Part::activeSession() const
Q_ASSERT(_viewManager->activeViewController()->session());
return _viewManager->activeViewController()->session();
}
}
return nullptr;
}
......@@ -175,7 +175,7 @@ int Part::foregroundProcessId()
if (activeSession()->isForegroundProcessActive()) {
return activeSession()->foregroundProcessId();
}
}
return -1;
}
......@@ -185,7 +185,7 @@ QString Part::foregroundProcessName()
if (activeSession()->isForegroundProcessActive()) {
return activeSession()->foregroundProcessName();
}
}
return QString();
}
......
......@@ -31,6 +31,7 @@
#include "history/HistoryType.h"
#include "history/HistoryScrollNone.h"
#include "ExtendedCharTable.h"
#include "profile/Profile.h"
using namespace Konsole;
......
......@@ -24,6 +24,7 @@
#include <QTextStream>
#include "TerminalCharacterDecoder.h"
#include "profile/Profile.h"
#include "Emulation.h"
namespace Konsole {
......
......@@ -29,7 +29,7 @@
#include "ExtendedCharTable.h"
#include "ColorScheme.h"
#include "ColorSchemeManager.h"
#include "Profile.h"
#include "profile/Profile.h"
using namespace Konsole;
PlainTextDecoder::PlainTextDecoder()
......
......@@ -24,15 +24,17 @@
// Qt
#include <QList>
#include <QExplicitlySharedDataPointer>
// Konsole
#include "Character.h"
#include "Profile.h"
#include "konsoleprivate_export.h"
class QTextStream;
namespace Konsole {
class Profile;
/**
* Base class for terminal character decoders
*
......@@ -120,7 +122,7 @@ public:
/**
* Constructs an HTML decoder using a default black-on-white color scheme.
*/
explicit HTMLDecoder(const Profile::Ptr &profile = Profile::Ptr());
explicit HTMLDecoder(const QExplicitlySharedDataPointer<Profile> &profile = QExplicitlySharedDataPointer<Profile>());
void decodeLine(const Character * const characters, int count,
LineProperty properties) override;
......@@ -133,7 +135,7 @@ private:
void closeSpan(QString &text);
QTextStream *_output;
Profile::Ptr _profile;
QExplicitlySharedDataPointer<Profile> _profile;
ColorEntry _colorTable[TABLE_COLORS];
bool _innerSpanOpen;
RenditionFlags _lastRendition;
......
......@@ -40,7 +40,7 @@
#include "widgets/TerminalDisplay.h"
#include "session/SessionController.h"
#include "session/SessionManager.h"
#include "ProfileManager.h"
#include "profile/ProfileManager.h"
#include "widgets/ViewSplitter.h"
#include "widgets/ViewContainer.h"
......
......@@ -26,21 +26,23 @@
#include <QObject>
#include <QPointer>
#include "konsoleprivate_export.h"
// Konsole
#include "Profile.h"
class KActionCollection;
class KConfigGroup;
namespace Konsole {
class ColorScheme;
class Profile;
class Session;
class TerminalDisplay;
class TabbedViewContainer;
class SessionController;
class TabbedViewContainer;
class TabbedViewContainer;
class TerminalDisplay;
class ViewProperties;
class ViewSplitter;
class TabbedViewContainer;
/**
* Manages the terminal display widgets in a Konsole window or part.
......@@ -84,7 +86,7 @@ public:
* Applies the view-specific settings associated with specified @p profile
* to the terminal display @p view.
*/
void applyProfileToView(TerminalDisplay *view, const Profile::Ptr &profile);
void applyProfileToView(TerminalDisplay *view, const QExplicitlySharedDataPointer<Profile> &profile);
void toggleActionsBasedOnState();
/**
......@@ -182,7 +184,7 @@ public:
/**
* Returns whether the @p profile has the blur setting enabled
*/
static bool profileHasBlurEnabled(const Profile::Ptr &profile);
static bool profileHasBlurEnabled(const QExplicitlySharedDataPointer<Profile> &profile);
/** returns the active tab from the view
*/
......@@ -190,7 +192,7 @@ public:
TerminalDisplay *createView(Session *session);
void attachView(TerminalDisplay *terminal, Session *session);
static const ColorScheme *colorSchemeForProfile(const Profile::Ptr &profile);
static const ColorScheme *colorSchemeForProfile(const QExplicitlySharedDataPointer<Profile> &profile);
/** Reorder the terminal display history list */
void updateTerminalDisplayHistory(TerminalDisplay *terminalDisplay = nullptr, bool remove = false);
......@@ -203,7 +205,7 @@ public:
* The session has specified @p profile, working @p directory
* and configured environment.
*/
Session* createSession(const Profile::Ptr &profile, const QString &directory = QString());
Session* createSession(const QExplicitlySharedDataPointer<Profile> &profile, const QString &directory = QString());
Q_SIGNALS:
/** Emitted when the last view is removed from the view manager */
......@@ -243,7 +245,7 @@ Q_SIGNALS:
/** Requests creation of a new view with the default profile. */
void newViewRequest();
/** Requests creation of a new view, with the selected profile. */
void newViewWithProfileRequest(const Profile::Ptr&);
void newViewWithProfileRequest(const QExplicitlySharedDataPointer<Profile> &profile);
public Q_SLOTS:
/** DBus slot that returns the number of sessions in the current view. */
......@@ -370,7 +372,7 @@ private Q_SLOTS:
void containerViewsChanged(TabbedViewContainer *container);
// called when a profile changes
void profileChanged(const Profile::Ptr &profile);
void profileChanged(const QExplicitlySharedDataPointer<Profile> &profile);
void updateViewsForSession(Session *session);
......
......@@ -20,8 +20,8 @@
// Own
#include "DBusTest.h"
#include "../session/Session.h"
#include "../Profile.h"
#include "../ProfileWriter.h"
#include "../profile/Profile.h"
#include "../profile/ProfileWriter.h"
// Qt
#include <QProcess>
......
......@@ -25,8 +25,8 @@
#include <QFileInfo>
// Konsole
#include "../Profile.h"
#include "../ProfileWriter.h"
#include "../profile/Profile.h"
#include "../profile/ProfileWriter.h"
#include <array>
......
......@@ -23,6 +23,8 @@
#include <QObject>
#include "../profile/Profile.h"
#include "../TerminalCharacterDecoder.h"
namespace Konsole
......
......@@ -19,8 +19,8 @@
// Own
#include "TerminalInterfaceTest.h"
#include "../Profile.h"
#include "../ProfileManager.h"
#include "../profile/Profile.h"
#include "../profile/ProfileManager.h"
#include "config-konsole.h"
// Qt
......
......@@ -24,7 +24,7 @@
#include "session/Session.h"
#include "session/SessionManager.h"
#include "Profile.h"
#include "profile/Profile.h"
#include "FileFilterHotspot.h"
......
......@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#include "TerminalImageFilterChain.h"
#include "profile/Profile.h"
#include <QTextStream>
......
......@@ -51,17 +51,17 @@
#include "SSHProcessInfo.h"
#include "Pty.h"
#include "widgets/TerminalDisplay.h"
#include "ShellCommand.h"
#include "Vt102Emulation.h"
#include "ZModemDialog.h"
#include "history/HistoryTypeNone.h"
#include "history/HistoryTypeFile.h"
#include "history/HistoryTypeNone.h"
#include "history/compact/CompactHistoryType.h"
#include "konsoledebug.h"
#include "profile/Profile.h"
#include "profile/ProfileManager.h"
#include "session/SessionManager.h"
#include "ProfileManager.h"
#include "Profile.h"
#include "widgets/TerminalDisplay.h"
using namespace Konsole;
......
......@@ -21,7 +21,7 @@
// Own
#include "session/SessionController.h"
#include "ProfileManager.h"
#include "profile/ProfileManager.h"
#include "konsoledebug.h"
// Qt
......@@ -59,9 +59,15 @@
#include <KNotification>
// Konsole
#include "EditProfileDialog.h"
#include "CopyInputDialog.h"
#include "Emulation.h"
#include "Enumeration.h"
#include "HistorySizeDialog.h"
#include "PrintOptions.h"
#include "RenameTabDialog.h"
#include "SaveHistoryTask.h"
#include "ScreenWindow.h"
#include "SearchHistoryTask.h"
#include "filterHotSpots/FileFilter.h"
#include "filterHotSpots/Filter.h"
#include "filterHotSpots/FilterChain.h"
......@@ -69,22 +75,16 @@
#include "filterHotSpots/RegExpFilter.h"
#include "filterHotSpots/UrlFilter.h"
#include "history/HistoryType.h"
#include "history/HistoryTypeNone.h"
#include "history/HistoryTypeFile.h"
#include "history/HistoryTypeNone.h"
#include "history/compact/CompactHistoryType.h"
#include "HistorySizeDialog.h"
#include "widgets/IncrementalSearchBar.h"
#include "RenameTabDialog.h"
#include "ScreenWindow.h"
#include "profile/EditProfileDialog.h"
#include "profile/ProfileList.h"
#include "session/Session.h"
#include "ProfileList.h"
#include "widgets/TerminalDisplay.h"
#include "session/SessionManager.h"
#include "Enumeration.h"
#include "PrintOptions.h"
#include "SaveHistoryTask.h"
#include "SearchHistoryTask.h"
#include "session/SessionGroup.h"
#include "session/SessionManager.h"
#include "widgets/IncrementalSearchBar.h"
#include "widgets/TerminalDisplay.h"
// For Unix signal names
#include <csignal>
......
......@@ -33,7 +33,6 @@
// Konsole
#include "SessionDisplayConnection.h"
#include "ViewProperties.h"
#include "Profile.h"
#include "Enumeration.h"
#include "session/Session.h"
......@@ -48,16 +47,17 @@ class QAction;
class KActionMenu;
namespace Konsole {
class Session;
class SessionGroup;
class ScreenWindow;
class TerminalDisplay;
class EditProfileDialog;
class FileFilter;
class IncrementalSearchBar;
class Profile;
class ProfileList;
class RegExpFilter;
class ScreenWindow;
class Session;
class SessionGroup;
class TerminalDisplay;
class UrlFilter;
class FileFilter;
class EditProfileDialog;
/**
* Provides the menu actions to manipulate a single terminal session and view pair.
......@@ -248,7 +248,7 @@ private Q_SLOTS:
void monitorSilence(bool monitor);
void monitorProcessFinish(bool monitor);
void renameSession();
void switchProfile(const Profile::Ptr &profile);
void switchProfile(const QExplicitlySharedDataPointer<Profile> &profile);
void handleWebShortcutAction();
void configureWebShortcuts();
void sendSignal(QAction *action);
......@@ -268,7 +268,7 @@ private Q_SLOTS:
void searchTextChanged(const QString &text);
void searchCompleted(bool success);
void updateFilterList(Profile::Ptr profile); // Called when the profile has changed, so we might need to change the list of filters
void updateFilterList(QExplicitlySharedDataPointer<Profile> profile); // Called when the profile has changed, so we might need to change the list of filters
void viewFocusChangeHandler(bool focused);
void interactionHandler();
......
......@@ -34,7 +34,7 @@
// Konsole
#include "session/Session.h"
#include "ProfileManager.h"
#include "profile/ProfileManager.h"
#include "history/HistoryTypeNone.h"
#include "history/HistoryTypeFile.h"
#include "history/compact/CompactHistoryType.h"
......
......@@ -25,14 +25,16 @@
// Qt
#include <QHash>
#include <QList>
#include <QExplicitlySharedDataPointer>
// Konsole
#include "Profile.h"
// TODO: Move the Property away from Profile.h