aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Vladimir Panteleev2016-07-09 06:28:25 +0000
committerGravatar staticfox2016-07-19 05:16:32 -0400
commitb489a366ba4f7903a4ff25bc21783d0a870bdab2 (patch)
tree309549a026c14ac7351e7a92e5933c882bbc70a8
parentRow/Col: Rename row to line and dont use 0 base for first line (diff)
downloadKVIrc-b489a366ba4f7903a4ff25bc21783d0a870bdab2.tar.gz
KVIrc-b489a366ba4f7903a4ff25bc21783d0a870bdab2.tar.bz2
KVIrc-b489a366ba4f7903a4ff25bc21783d0a870bdab2.zip
Give better names to console log files
This patch names console log files after the IRC network. Note that the console windows are created without a connection initially. To avoid creating mostly-empty indexed log files, we do not begin logging until a connection is created. Fixes #1710.
-rw-r--r--src/kvirc/ui/KviConsoleWindow.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/kvirc/ui/KviConsoleWindow.cpp b/src/kvirc/ui/KviConsoleWindow.cpp
index ce54c9c40..3ce48d585 100644
--- a/src/kvirc/ui/KviConsoleWindow.cpp
+++ b/src/kvirc/ui/KviConsoleWindow.cpp
@@ -143,9 +143,6 @@ KviConsoleWindow::KviConsoleWindow(int iFlags)
m_pTmpHighLightedChannels = new QStringList;
- if(KVI_OPTION_BOOL(KviOption_boolAutoLogConsole))
- m_pIrcView->startLogging();
-
applyOptions();
}
@@ -396,7 +393,10 @@ void KviConsoleWindow::saveProperties(KviConfigurationFile * cfg)
void KviConsoleWindow::getBaseLogFileName(QString & buffer)
{
- buffer = QString("CONSOLE_%1").arg(context()->id());
+ if(context()->connection())
+ buffer = context()->connection()->target()->network()->name();
+ else
+ buffer = context()->id();
}
void KviConsoleWindow::showNotifyList(bool bShow, bool bIgnoreSizeChange)
@@ -504,6 +504,14 @@ void KviConsoleWindow::connectionAttached()
connect(m_pContext->connection(), SIGNAL(chanListChanged()), this, SLOT(updateUri()));
updateUri();
m_pNotifyListView->setUserDataBase(connection()->userDataBase());
+
+ // Update log file name
+ if(KVI_OPTION_BOOL(KviOption_boolAutoLogConsole))
+ {
+ if (m_pIrcView->isLogging())
+ m_pIrcView->stopLogging();
+ m_pIrcView->startLogging();
+ }
}
void KviConsoleWindow::connectionDetached()