aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-21 10:30:10 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-21 10:30:10 (GMT)
commit8141ccd00c867c6a679be79d18fa822e2f8e102c (patch)
tree4c13a5afde803dec59ae87cf68cbc8c24523f50d
parentf81ff78a53eb7a3a76567f1b61bd35671f5de8f5 (diff)
less friends
-rw-r--r--kate/app/kateconfigdialog.cpp4
-rw-r--r--kate/app/katemainwindow.cpp16
-rw-r--r--kate/app/katemainwindow.h35
-rw-r--r--kate/app/kateviewmanager.cpp8
-rw-r--r--kate/app/kateviewmanager.h2
-rw-r--r--kate/app/kateviewspace.h5
6 files changed, 40 insertions, 30 deletions
diff --git a/kate/app/kateconfigdialog.cpp b/kate/app/kateconfigdialog.cpp
index bf4225a..548c332 100644
--- a/kate/app/kateconfigdialog.cpp
+++ b/kate/app/kateconfigdialog.cpp
@@ -85,7 +85,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
// modified files notification
m_modNotifications = new QCheckBox(
i18n("Wa&rn about files modified by foreign processes"), buttonGroup );
- m_modNotifications->setChecked( parent->modNotification );
+ m_modNotifications->setChecked( parent->modNotificationEnabled() );
m_modNotifications->setWhatsThis( i18n(
"If enabled, when Kate receives focus you will be asked what to do with "
"files that have been modified on the hard disk. If not enabled, you will "
@@ -334,7 +334,7 @@ void KateConfigDialog::slotApply()
KateDocManager::self()->setDaysMetaInfos(m_daysMetaInfos->value());
cg.writeEntry("Modified Notification", m_modNotifications->isChecked());
- m_mainWindow->modNotification = m_modNotifications->isChecked();
+ m_mainWindow->setModNotificationEnabled (m_modNotifications->isChecked());
// patch document modified warn state
const QList<KTextEditor::Document*> &docs = KateDocManager::self()->documentList ();
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index f10aec4..3be7e27 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -188,7 +188,7 @@ KateMainWindow::KateMainWindow (KConfig *sconfig, const QString &sgroup)
finishRestore ();
- fileOpenRecent->loadEntries( KConfigGroup(sconfig, "Recent Files" ) );
+ m_fileOpenRecent->loadEntries( KConfigGroup(sconfig, "Recent Files" ) );
setAcceptDrops(true);
@@ -269,9 +269,9 @@ void KateMainWindow::setupActions()
actionCollection()->addAction( KStandardAction::Open, QStringLiteral("file_open"), m_viewManager, SLOT(slotDocumentOpen()) )
->setWhatsThis(i18n("Open an existing document for editing"));
- fileOpenRecent = KStandardAction::openRecent (m_viewManager, SLOT(openUrl(QUrl)), this);
- actionCollection()->addAction(fileOpenRecent->objectName(), fileOpenRecent);
- fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
+ m_fileOpenRecent = KStandardAction::openRecent (m_viewManager, SLOT(openUrl(QUrl)), this);
+ actionCollection()->addAction(m_fileOpenRecent->objectName(), m_fileOpenRecent);
+ m_fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
a = actionCollection()->addAction( QStringLiteral("file_save_all") );
a->setIcon( QIcon::fromTheme(QStringLiteral("document-save-all")) );
@@ -534,7 +534,7 @@ void KateMainWindow::readOptions ()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
const KConfigGroup generalGroup(config, "General");
- modNotification = generalGroup.readEntry("Modified Notification", false);
+ m_modNotification = generalGroup.readEntry("Modified Notification", false);
KateDocManager::self()->setSaveMetaInfos(generalGroup.readEntry("Save Meta Infos", true));
KateDocManager::self()->setDaysMetaInfos(generalGroup.readEntry("Days Meta Infos", 30));
@@ -899,7 +899,7 @@ void KateMainWindow::saveProperties(KConfigGroup& config)
}
}
- fileOpenRecent->saveEntries( KConfigGroup(config.config(), "Recent Files" ) );
+ m_fileOpenRecent->saveEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_viewManager->saveViewConfiguration (config);
}
@@ -915,7 +915,7 @@ void KateMainWindow::readProperties(const KConfigGroup& config)
finishRestore ();
- fileOpenRecent->loadEntries( KConfigGroup(config.config(), "Recent Files" ) );
+ m_fileOpenRecent->loadEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_viewManager->restoreViewConfiguration (config);
}
@@ -967,7 +967,7 @@ void KateMainWindow::slotUpdateBottomViewBar()
void KateMainWindow::queueModifiedOnDisc(KTextEditor::Document *doc)
{
- if (!modNotification) return;
+ if (!m_modNotification) return;
if (s_modOnHdDialog==0) {
DocVector list;
diff --git a/kate/app/katemainwindow.h b/kate/app/katemainwindow.h
index 115989a..9ab96fe 100644
--- a/kate/app/katemainwindow.h
+++ b/kate/app/katemainwindow.h
@@ -70,9 +70,6 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
{
Q_OBJECT
- friend class KateConfigDialog;
- friend class KateViewManager;
-
public:
/**
* Construct the window and restore its state from given config if any
@@ -142,6 +139,11 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
void restoreWindowConfig(const KConfigGroup &);
+ /**
+ * save some global options to katerc
+ */
+ void saveOptions();
+
private:
/**
* Setup actions which pointers are needed already in setupMainWindow
@@ -157,11 +159,6 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
void readOptions();
- /**
- * save some global options to katerc
- */
- void saveOptions();
-
void dragEnterEvent( QDragEnterEvent * );
void dropEvent( QDropEvent * );
@@ -232,6 +229,21 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
inline void showBottomViewBarForView(KTextEditor::View *view) {QWidget *bar; BarState state=m_bottomViewBarMapping.value(view); bar=state.bar(); if (bar) {m_bottomContainerStack->setCurrentWidget(bar); bar->show(); state.setState(true); m_bottomViewBarMapping[view]=state; m_bottomViewBarContainer->show();}}
inline void deleteBottomViewBarForView(KTextEditor::View *view) {QWidget *bar; BarState state=m_bottomViewBarMapping.take(view); bar=state.bar(); if (bar) {if (m_bottomContainerStack->currentWidget()==bar) m_bottomViewBarContainer->hide(); delete bar;}}
+ bool modNotificationEnabled () const
+ {
+ return m_modNotification;
+ }
+
+ void setModNotificationEnabled (bool e)
+ {
+ m_modNotification = e;
+ }
+
+ KRecentFilesAction *fileOpenRecent () const
+ {
+ return m_fileOpenRecent;
+ }
+
//
// KTextEditor::MainWindow interface, get called by invokeMethod from our wrapper object!
//
@@ -403,7 +415,10 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
static uint uniqueID;
uint myID;
- bool modNotification;
+ /**
+ * Notify about file modifications from other processes?
+ */
+ bool m_modNotification;
/**
* stacked widget containing the central area, aka view manager, quickopen, ...
@@ -420,7 +435,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
KateViewManager *m_viewManager;
- KRecentFilesAction *fileOpenRecent;
+ KRecentFilesAction *m_fileOpenRecent;
KActionMenu* documentOpenWith;
diff --git a/kate/app/kateviewmanager.cpp b/kate/app/kateviewmanager.cpp
index 1cf111d..a128717 100644
--- a/kate/app/kateviewmanager.cpp
+++ b/kate/app/kateviewmanager.cpp
@@ -313,7 +313,7 @@ KTextEditor::Document *KateViewManager::openUrl (const QUrl &url,
KTextEditor::Document *doc = KateDocManager::self()->openUrl (url, encoding, isTempFile, docInfo);
if (!doc->url().isEmpty())
- m_mainWindow->fileOpenRecent->addUrl( doc->url() );
+ m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
if (activate)
activateView( doc );
@@ -330,7 +330,7 @@ KTextEditor::Document *KateViewManager::openUrls (const QList<QUrl> &urls,
foreach (const KTextEditor::Document *doc, docs) {
if (!doc->url().isEmpty()) {
- m_mainWindow->fileOpenRecent->addUrl( doc->url() );
+ m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
}
}
@@ -345,7 +345,7 @@ KTextEditor::View *KateViewManager::openUrlWithView (const QUrl &url, const QStr
return 0;
if (!doc->url().isEmpty())
- m_mainWindow->fileOpenRecent->addUrl( doc->url() );
+ m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
activateView( doc );
@@ -418,7 +418,7 @@ void KateViewManager::documentDeleted (KTextEditor::Document *)
void KateViewManager::documentSavedOrUploaded(KTextEditor::Document *doc, bool)
{
if (!doc->url().isEmpty())
- m_mainWindow->fileOpenRecent->addUrl( doc->url() );
+ m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
}
bool KateViewManager::createView ( KTextEditor::Document *doc )
diff --git a/kate/app/kateviewmanager.h b/kate/app/kateviewmanager.h
index 7e77e48..c56020b 100644
--- a/kate/app/kateviewmanager.h
+++ b/kate/app/kateviewmanager.h
@@ -296,8 +296,6 @@ class KateViewManager : public QSplitter
* current minimal age
*/
qint64 m_minAge;
-
- friend class KateContainer;
};
#endif
diff --git a/kate/app/kateviewspace.h b/kate/app/kateviewspace.h
index 3b17695..fc67ffb 100644
--- a/kate/app/kateviewspace.h
+++ b/kate/app/kateviewspace.h
@@ -90,14 +90,12 @@ class KateVSStatusBar : public QStatusBar
class KateViewSpace : public QFrame
{
- friend class KateVSStatusBar;
-
Q_OBJECT
public:
explicit KateViewSpace(KateViewManager *, QWidget* parent = 0, const char* name = 0);
~KateViewSpace();
-
+
bool isActiveSpace();
void setActive(bool b, bool showled = false);
@@ -141,4 +139,3 @@ class KateViewSpace : public QFrame
};
#endif
-// kate: space-indent on; indent-width 2; replace-tabs on;