From 690dd7a33ddc90678367d73adf313533536e10f2 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Fri, 29 Apr 2016 23:57:30 +0100 Subject: Apply clang-format --- src/modules/options/OptionsWidget_urlHandlers.cpp | 122 +++++++++++++--------- 1 file changed, 72 insertions(+), 50 deletions(-) (limited to 'src/modules/options/OptionsWidget_urlHandlers.cpp') diff --git a/src/modules/options/OptionsWidget_urlHandlers.cpp b/src/modules/options/OptionsWidget_urlHandlers.cpp index 56f421fdf..fdc87f9f5 100644 --- a/src/modules/options/OptionsWidget_urlHandlers.cpp +++ b/src/modules/options/OptionsWidget_urlHandlers.cpp @@ -33,25 +33,24 @@ #include #include - OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #define START_ROW 2 +#define START_ROW 2 #else - #define START_ROW 1 +#define START_ROW 1 #endif setObjectName("urlhandlers_options_widget"); createLayout(); - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Mouse Handler","options")); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Mouse Handler", "options")); - addLabel(gbox,__tr2qs_ctx("How many clicks to open links?","options")); + addLabel(gbox, __tr2qs_ctx("How many clicks to open links?", "options")); - m_pClickRadio = new QRadioButton(__tr2qs_ctx("Single-click","options"),gbox); - m_pDoubleClickRadio = new QRadioButton(__tr2qs_ctx("Double-click","options"),gbox); + m_pClickRadio = new QRadioButton(__tr2qs_ctx("Single-click", "options"), gbox); + m_pDoubleClickRadio = new QRadioButton(__tr2qs_ctx("Double-click", "options"), gbox); switch(KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)) { @@ -63,23 +62,23 @@ OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) break; } - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Protocol Handler","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Protocol Handler", "options")); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - KviBoolSelector *b = addBoolSelector(gbox,__tr2qs_ctx("Use system URL handlers","options"),KviOption_boolUseSystemUrlHandlers); + KviBoolSelector * b = addBoolSelector(gbox, __tr2qs_ctx("Use system URL handlers", "options"), KviOption_boolUseSystemUrlHandlers); #endif - m_pHttpHandler=addStringSelector(gbox,__tr2qs_ctx("http:// handler command:","options"),KviOption_stringUrlHttpCommand); + m_pHttpHandler = addStringSelector(gbox, __tr2qs_ctx("http:// handler command:", "options"), KviOption_stringUrlHttpCommand); m_pHttpHandler->setMinimumLabelWidth(225); - m_pHttpsHandler=addStringSelector(gbox,__tr2qs_ctx("https:// handler command:","options"),KviOption_stringUrlHttpsCommand); + m_pHttpsHandler = addStringSelector(gbox, __tr2qs_ctx("https:// handler command:", "options"), KviOption_stringUrlHttpsCommand); m_pHttpsHandler->setMinimumLabelWidth(225); - m_pFtpHandler=addStringSelector(gbox,__tr2qs_ctx("ftp:// handler command:","options"),KviOption_stringUrlFtpCommand); + m_pFtpHandler = addStringSelector(gbox, __tr2qs_ctx("ftp:// handler command:", "options"), KviOption_stringUrlFtpCommand); m_pFtpHandler->setMinimumLabelWidth(225); - m_pMailtoHandler=addStringSelector(gbox,__tr2qs_ctx("mailto: handler command:","options"),KviOption_stringUrlMailtoCommand); + m_pMailtoHandler = addStringSelector(gbox, __tr2qs_ctx("mailto: handler command:", "options"), KviOption_stringUrlMailtoCommand); m_pMailtoHandler->setMinimumLabelWidth(225); - m_pFileHandler=addStringSelector(gbox,__tr2qs_ctx("file:// handler command:","options"),KviOption_stringUrlFileCommand); + m_pFileHandler = addStringSelector(gbox, __tr2qs_ctx("file:// handler command:", "options"), KviOption_stringUrlFileCommand); m_pFileHandler->setMinimumLabelWidth(225); - m_pOtherHandler=addStringSelector(gbox,__tr2qs_ctx("Unknown protocol handler command:","options"),KviOption_stringUrlUnknownCommand); + m_pOtherHandler = addStringSelector(gbox, __tr2qs_ctx("Unknown protocol handler command:", "options"), KviOption_stringUrlUnknownCommand); m_pOtherHandler->setMinimumLabelWidth(225); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) @@ -89,10 +88,10 @@ OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) m_pFileHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); m_pMailtoHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); m_pOtherHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); - connect(b,SIGNAL(toggled(bool)),this,SLOT(toggleEditors(bool))); + connect(b, SIGNAL(toggled(bool)), this, SLOT(toggleEditors(bool))); #endif - addRowSpacer(0,START_ROW+6,0,START_ROW+6); + addRowSpacer(0, START_ROW + 6, 0, START_ROW + 6); } OptionsWidget_urlHandlers::~OptionsWidget_urlHandlers() @@ -114,44 +113,67 @@ void OptionsWidget_urlHandlers::commit() KviOptionsWidget::commit(); if(m_pClickRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)=1; + KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum) = 1; if(m_pDoubleClickRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)=2; + KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum) = 2; #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("@MAGIC@","\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("@MAGIC@", "\\\\"); //Check for escaped " in url handler ( \" ) - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\\\\"","\\\""); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\\\\"", "\\\""); #endif } - #endif //_OPTW_URLHANDLERS_CPP_ -- cgit v1.3.1-10-gc9f91