[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/kexi-frameworks7-staniek] kexi/main: As the Qt docs say: argc should be int&
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2015-06-30 20:24:21
Message-ID: E1ZA24r-0006Ps-F0 () scm ! kde ! org
[Download RAW message or body]

Git commit 1fb965c3e100195725ddf4f8f60a167a15dceb00 by Jaroslaw Staniek.
Committed on 30/06/2015 at 20:16.
Pushed by staniek into branch 'kexi-frameworks7-staniek'.

As the Qt docs say: argc should be int&

"The data referred to by argc and argv must stay valid for the entire lifetime of the \
QApplication object"

See http://doc.qt.io/qt-5/qapplication.html#QApplication

M  +1    -1    kexi/main/KexiMainWindow.cpp
M  +4    -2    kexi/main/KexiMainWindow.h

http://commits.kde.org/calligra/1fb965c3e100195725ddf4f8f60a167a15dceb00

diff --git a/kexi/main/KexiMainWindow.cpp b/kexi/main/KexiMainWindow.cpp
index 9ef4926..eba233a 100644
--- a/kexi/main/KexiMainWindow.cpp
+++ b/kexi/main/KexiMainWindow.cpp
@@ -296,7 +296,7 @@ void KexiMainWindowTabWidget::setTabIndexFromContextMenu(int \
clickedIndex)  //-------------------------------------------------
 
 //static
-int KexiMainWindow::create(int argc, char *argv[], const QString &componentName)
+int KexiMainWindow::create(int &argc, char *argv[], const QString &componentName)
 {
     const bool appExisted = qApp;
 
diff --git a/kexi/main/KexiMainWindow.h b/kexi/main/KexiMainWindow.h
index 780e5fb..b2f5869 100644
--- a/kexi/main/KexiMainWindow.h
+++ b/kexi/main/KexiMainWindow.h
@@ -69,8 +69,10 @@ public:
      If @a componentName is provided, it is assigned to application's \
                KAboutData::componentName.
      It's not used by Kexi itself but this is useful for test application that are \
based  on KexiMainWindow.
-     @return result 1 on error and 0 on success (the result can be used as a result \
                of main()) */
-    static int create(int argc, char *argv[], const QString &componentName = \
QString()); +     @return result 1 on error and 0 on success (the result can be used \
as a result of main()) +     @note Yes, the data referred to by argc and argv must \
stay valid for the entire lifetime +          of the QApplication object so int& is \
used. */ +    static int create(int &argc, char *argv[], const QString &componentName \
= QString());  
     //! Project data of currently opened project or NULL if no project here yet.
     virtual KexiProject *project();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic