example/AuthApp/main.cpp
author cgandhi
Thu, 05 Aug 2010 16:51:04 +0530
changeset 19 c412f0526c34
parent 17 106a4bfcb866
permissions -rw-r--r--
pushing readme changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     1
/****************************************************************************
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     2
**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     3
** Trolltech hereby grants a license to use the Qt/Eclipse Integration
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     4
** plug-in (the software contained herein), in binary form, solely for the
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     5
** purpose of creating code to be used with Trolltech's Qt software.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     6
**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     7
** Qt Designer is licensed under the terms of the GNU General Public
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     8
** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     9
** right to use certain no GPL licensed software under the terms of its GPL
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    10
** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    11
**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    12
** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "AS
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    13
** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    14
** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    15
** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    16
** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    17
** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    18
** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    19
** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    20
** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    21
** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    22
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    23
**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    24
** Since we now have the GPL exception I think that the "special exception
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    25
** is no longer needed. The license text proposed above (other than the
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    26
** special exception portion of it) is the BSD license and we have added
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    27
** the BSD license as a permissible license under the exception.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    28
**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    29
****************************************************************************/
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    30
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    31
#include "AuthApp.h"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    32
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    33
#include <QtGui>
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    34
#include <QApplication>
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    35
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    36
void debugOutput(QtMsgType type, const char *msg)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    37
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    38
	QFile logFile("c://data//FaceBookLog.txt");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    39
	Q_ASSERT(logFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    40
	QTextStream stream(&logFile);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    41
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    42
	switch (type)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    43
		{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    44
		case QtDebugMsg:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    45
			stream<<msg<<"\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    46
			break;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    47
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    48
		case QtWarningMsg:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    49
			stream<<"Warning: ";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    50
			stream<<msg<<"\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    51
			break;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    52
			
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    53
		case QtCriticalMsg:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    54
			stream<<"Critical: ";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    55
			stream<<msg<<"\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    56
			break;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    57
			
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    58
		case QtFatalMsg:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    59
			stream<<"Fatal: ";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    60
			stream<<msg<<"\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    61
			break;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    62
			
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    63
		default:;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    64
		}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    65
	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    66
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    67
int main(int argc, char *argv[])
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    68
{
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    69
	qInstallMsgHandler(debugOutput);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    70
    QApplication a(argc, argv);
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    71
    qDebug()<<"Inside main()";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
    AuthApp w;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    73
    
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    74
	#if defined(Q_OS_SYMBIAN)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    75
		w.showMaximized();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    76
	#else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    77
		w.show();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    78
	#endif
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    79
		
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    80
    return a.exec();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    81
}