From ac9037ffa9e8b56393c111f52e873a53508937e4 Mon Sep 17 00:00:00 2001 From: markuspg Date: Fri, 23 Sep 2016 23:30:40 +0200 Subject: [PATCH] Removed unused 'Session' related variables from 'Lablib' --- src/Lib/lablib.cpp | 15 --------------- src/Lib/lablib.h | 11 ----------- src/sessionstarter.cpp | 17 ++++------------- src/sessionstarter.h | 5 ++--- 4 files changed, 6 insertions(+), 42 deletions(-) diff --git a/src/Lib/lablib.cpp b/src/Lib/lablib.cpp index 668a4cf..41c4ecc 100644 --- a/src/Lib/lablib.cpp +++ b/src/Lib/lablib.cpp @@ -269,16 +269,6 @@ void lc::Lablib::ReadSettings() { } } -void lc::Lablib::SetAnonymousReceiptsPlaceholder( const QString &argPlaceHolder ) { - anonymousReceiptsPlaceholder = argPlaceHolder; - debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] anonymous_receipts_placeholder set to: '%1'" ).arg( anonymousReceiptsPlaceholder ) ); -} - -void lc::Lablib::SetChosenLaTeXHeader( const QString &argLatexHeader ) { - chosenLaTeXHeader = argLatexHeader; - debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] chosen_latex_header set to: '%1'" ).arg( chosenLaTeXHeader ) ); -} - void lc::Lablib::SetChosenZTreeDataTargetPath( const QString &argZTreeDataTargetPath ) { chosenZTreeDataTargetPath = argZTreeDataTargetPath; debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] chosen_zTree_data_target_path set to: '%1'" ).arg( chosenZTreeDataTargetPath ) ); @@ -289,11 +279,6 @@ void lc::Lablib::SetChosenZTreePort( const int &argPort ) { debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] chosen_zTree_port set to: '%1'" ).arg( QString::number( chosenZTreePort ) ) ); } -void lc::Lablib::SetChosenZTreeVersion( const QString &argZTreeVersion ) { - chosenZTreeVersion = QString{ "zTree_" + argZTreeVersion }; - debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] chosen_zTree_version set to: '%1'" ).arg( chosenZTreeVersion ) ); -} - void lc::Lablib::SetPrintReceiptsForLocalClients( const bool &argPrintReceiptsForLocalClients ) { PrintReceiptsForLocalClients = argPrintReceiptsForLocalClients; debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] Set print_receipts_for_local_clients to : '%1'" ).arg( QString::number( PrintReceiptsForLocalClients ) ) ); diff --git a/src/Lib/lablib.h b/src/Lib/lablib.h index 5d515d4..e7ef203 100644 --- a/src/Lib/lablib.h +++ b/src/Lib/lablib.h @@ -71,11 +71,6 @@ public: * @return The users with administrative rights */ QStringList *GetAdminUsers() const { return adminUsers; } - /*! Returns the placeholder for anonymous receipts - * - * @return The placeholder for anonymous receipts - */ - QString GetAnonymousReceiptsPlaceholder() const { return anonymousReceiptsPlaceholder; } /*! Returns the currently set port number of zTree * * @return The currently set port number for zTree @@ -131,11 +126,8 @@ public: * @return A pointer to a QStringList containing all available webcams */ QStringList *GetWebcams () const { return webcams; } - void SetAnonymousReceiptsPlaceholder( const QString &argPlaceHolder ); - void SetChosenLaTeXHeader( const QString &argLatexHeader ); void SetChosenZTreeDataTargetPath( const QString &argZTreeDataTargetPath ); void SetChosenZTreePort( const int &argPort ); - void SetChosenZTreeVersion( const QString &argZTreeVersion ); //! Sets the default name of local zLeaf instances /** * @param argName The default name local zLeaf instances shall have @@ -166,11 +158,8 @@ private: void ReadSettings(); QStringList *adminUsers = nullptr; //! Stores all users with administrative rights - QString anonymousReceiptsPlaceholder; //! The placeholder which shall substitute the client names on anonymous receipts (if != "") - QString chosenLaTeXHeader; QString chosenZTreeDataTargetPath; int chosenZTreePort = 7000; //! Stores the currently chosen port for new zTree instances - QString chosenZTreeVersion; ClientHelpNotificationServer *clientHelpNotificationServer = nullptr; //! A server to retrieve help requests from the clients unsigned short int clientHelpNotificationServerPort = 0; //! The port the help requests shall be received on QMap< QString, Client* > * clientIPsToClientsMap = nullptr; //! A map container storing ip-client pairs diff --git a/src/sessionstarter.cpp b/src/sessionstarter.cpp index 40dc0cc..08afdc1 100644 --- a/src/sessionstarter.cpp +++ b/src/sessionstarter.cpp @@ -58,18 +58,14 @@ void lc::SessionStarter::on_CBDataTargetPath_activated(const QString &arg1) { lablib->SetChosenZTreeDataTargetPath( arg1 ); } -void lc::SessionStarter::on_CBReceiptsHeader_activated(const QString &arg1) { +void lc::SessionStarter::on_CBReceiptsHeader_activated( const QString &argHeader ) { + Q_UNUSED( argHeader ); ui->CBReceiptsHeader->setStyleSheet( "" ); - lablib->SetChosenLaTeXHeader( arg1 ); } -void lc::SessionStarter::on_CBReplaceParticipantName_currentTextChanged(const QString &arg1) { - lablib->SetAnonymousReceiptsPlaceholder( arg1 ); -} - -void lc::SessionStarter::on_CBzTreeVersion_activated(const QString &arg1) { +void lc::SessionStarter::on_CBzTreeVersion_activated( const QString &argVersion ) { + Q_UNUSED( argVersion ); ui->CBzTreeVersion->setStyleSheet( "" ); - lablib->SetChosenZTreeVersion( arg1 ); } void lc::SessionStarter::on_ChBPrintanonymousreceipts_clicked( bool checked ) { @@ -78,14 +74,10 @@ void lc::SessionStarter::on_ChBPrintanonymousreceipts_clicked( bool checked ) { ui->LReplaceParticipantName->setEnabled( true ); ui->CBReplaceParticipantName->setEnabled( true ); ui->CBReplaceParticipantName->setStyleSheet( "background: cyan" ); - // Pass the currently chosen placeholder - lablib->SetAnonymousReceiptsPlaceholder( ui->CBReplaceParticipantName->currentText() ); } else { ui->LReplaceParticipantName->setEnabled( false ); ui->CBReplaceParticipantName->setEnabled( false ); ui->CBReplaceParticipantName->setStyleSheet( "" ); - // Pass an empty QString as signal, that receipts shall not be anonymous - lablib->SetAnonymousReceiptsPlaceholder( "" ); } ui->ChBPrintanonymousreceipts->setStyleSheet( "" ); } @@ -151,7 +143,6 @@ void lc::SessionStarter::SetupWidgets() { this, &SessionStarter::GetNewDataTargetPath ); // Since filling a QComboBox does not emit the 'activated' signal, initially set some variables manually - lablib->SetChosenLaTeXHeader( ui->CBReceiptsHeader->currentText() ); lablib->SetChosenZTreeDataTargetPath( ui->CBDataTargetPath->currentText() ); // Set the initial status of CBReceiptsforLocalClients according to the settings in lcLablib diff --git a/src/sessionstarter.h b/src/sessionstarter.h index 28c631a..6b52f42 100644 --- a/src/sessionstarter.h +++ b/src/sessionstarter.h @@ -59,9 +59,8 @@ private slots: //! Opens a 'QFileDialog' and tries to choose a new zTree data target path void GetNewDataTargetPath(); void on_CBDataTargetPath_activated(const QString &arg1); - void on_CBReceiptsHeader_activated(const QString &arg1); - void on_CBReplaceParticipantName_currentTextChanged(const QString &arg1); - void on_CBzTreeVersion_activated(const QString &arg1); + void on_CBReceiptsHeader_activated( const QString &argHeader ); + void on_CBzTreeVersion_activated( const QString &argVersion ); void on_ChBPrintanonymousreceipts_clicked( bool checked ); void on_ChBReceiptsforLocalClients_clicked(bool checked); void on_PBStartzTree_clicked();