Skip to content

Commit cbca809

Browse files
author
timlinux
committedSep 11, 2009
Added contributors list to qgsabout as requested by Germán Carrillo - and implemented attendant changes needed to support this. Also cleanups for the QgsAbout dialog to remove deprecated / unused code.
git-svn-id: http://svn.osgeo.org/qgis/trunk@11628 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7a87b13 commit cbca809

File tree

7 files changed

+225
-220
lines changed

7 files changed

+225
-220
lines changed
 

‎CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ ENDIF (ENABLE_TESTS)
395395
#############################################################
396396
# install stuff
397397

398-
INSTALL (FILES AUTHORS SPONSORS DONORS TRANSLATORS INSTALL CODING
398+
INSTALL (FILES AUTHORS CONTRIBUTORS SPONSORS DONORS TRANSLATORS INSTALL CODING
399399
DESTINATION ${QGIS_DATA_DIR}/doc)
400400

401401
# manual page - makes sense only on unix systems

‎CONTRIBUTORS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
The following people have submitted code, patches, graphics, comments,
2-
feedback, reviews and/or many other things that have aided the development of
3-
QGIS:
4-
1+
# This file will be used to populate the contributors tab in the about dialog
2+
# Lines prefixed with # will be ignored
3+
# The following people have submitted code, patches, graphics, comments,
4+
# feedback, reviews and/or many other things that have aided the development of
5+
# QGIS:
6+
#
57
Arthur Nanni
68
Baba Yoshihiko
79
Brent Wood
@@ -17,12 +19,10 @@ Hyao (IRC nickname)
1719
Ivan Lucena
1820
Jean-Denis Giguere
1921
Jerrit Collord
20-
Jürgen E. Fischer
2122
Magnus Homann
2223
Markus Neteler
2324
Maurizio Napolitano
2425
Paul Ramsey
25-
Peter Ersts
2626
Richard Kostecky
2727
Stefanie Tellex
2828
Tom Russo

‎src/app/qgsabout.cpp

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,53 +55,64 @@ void QgsAbout::init()
5555
QPixmap icon( QgsApplication::iconsPath() + "qgis-icon-60x60.png" );
5656
qgisIcon->setPixmap( icon );
5757

58-
//read the authors file to populate the contributors list
58+
//read the authors file to populate the svn committers list
5959
QStringList lines;
6060

61+
//
62+
// Load the authors (svn committers) list
63+
//
6164
QFile file( QgsApplication::authorsFilePath() );
62-
#ifdef QGISDEBUG
63-
printf( "Reading authors file %s.............................................\n",
64-
file.fileName().toLocal8Bit().constData() );
65-
#endif
6665
if ( file.open( QIODevice::ReadOnly ) )
6766
{
6867
QTextStream stream( &file );
6968
// Always use UTF-8
7069
stream.setCodec( "UTF-8" );
7170
QString line;
72-
#ifdef QGISDEBUG
73-
int i = 1;
74-
#endif
75-
7671
while ( !stream.atEnd() )
7772
{
7873
line = stream.readLine(); // line of text excluding '\n'
7974
//ignore the line if it starts with a hash....
8075
if ( line.left( 1 ) == "#" ) continue;
81-
#ifdef QGISDEBUG
82-
printf( "Contributor: %3d: %s\n", i++, line.toLocal8Bit().constData() );
83-
#endif
8476
QStringList myTokens = line.split( "\t", QString::SkipEmptyParts );
85-
//printf ("Added contributor name to listbox: %s ",myTokens[0]);
8677
lines += myTokens[0];
87-
88-
// add the image to the map
89-
/* Uncomment this block to preload the images (takes time at initial startup)
90-
QString authorName = myTokens[0].replace(" ","_");
91-
92-
QString myString =QString(appPath + "/images/developers/") + authorName + QString(".jpg");
93-
printf ("Loading mug: %s\n", myString.toLocal8Bit().constData());
94-
QPixmap *pixmap = new QPixmap(myString);
95-
mugs[myTokens[0]] = *pixmap;
96-
*/
9778
}
9879
file.close();
99-
listBox1->clear();
100-
listBox1->insertItems( 0, lines );
80+
lstDevelopers->clear();
81+
lstDevelopers->insertItems( 0, lines );
10182

102-
// Load in the image for the first author
103-
if ( listBox1->count() > 0 )
104-
listBox1->setCurrentRow( 0 );
83+
if ( lstDevelopers->count() > 0 )
84+
{
85+
lstDevelopers->setCurrentRow( 0 );
86+
}
87+
}
88+
89+
lines.clear();
90+
//
91+
// Now load up the contributors list
92+
//
93+
QFile file2( QgsApplication::contributorsFilePath() );
94+
printf( "Reading contributors file %s.............................................\n",
95+
file2.fileName().toLocal8Bit().constData() );
96+
if ( file2.open( QIODevice::ReadOnly ) )
97+
{
98+
QTextStream stream( &file2 );
99+
// Always use UTF-8
100+
stream.setCodec( "UTF-8" );
101+
QString line;
102+
while ( !stream.atEnd() )
103+
{
104+
line = stream.readLine(); // line of text excluding '\n'
105+
//ignore the line if it starts with a hash....
106+
if ( line.left( 1 ) == "#" ) continue;
107+
lines += line;
108+
}
109+
file2.close();
110+
lstContributors->clear();
111+
lstContributors->insertItems( 0, lines );
112+
if ( lstContributors->count() > 0 )
113+
{
114+
lstContributors->setCurrentRow( 0 );
115+
}
105116
}
106117

107118

@@ -294,38 +305,16 @@ void QgsAbout::setPluginInfo()
294305
myString += "</li>\n</ol>\n";
295306

296307
QString myStyle = QgsApplication::reportStyleSheet();
297-
txtBrowserPlugins->clear();
298-
txtBrowserPlugins->document()->setDefaultStyleSheet( myStyle );
299-
txtBrowserPlugins->setText( myString );
308+
txtProviders->clear();
309+
txtProviders->document()->setDefaultStyleSheet( myStyle );
310+
txtProviders->setText( myString );
300311
}
301312

302313
void QgsAbout::on_buttonCancel_clicked()
303314
{
304315
reject();
305316
}
306317

307-
void QgsAbout::on_listBox1_currentItemChanged( QListWidgetItem *theItem )
308-
{
309-
//replace spaces in author name
310-
#ifdef QGISDEBUG
311-
printf( "Loading mug: " );
312-
#endif
313-
QString myString = listBox1->currentItem()->text();
314-
myString = myString.replace( " ", "_" );
315-
myString = QgsAbout::fileSystemSafe( myString );
316-
#ifdef QGISDEBUG
317-
printf( "Loading mug: %s", myString.toLocal8Bit().constData() );
318-
#endif
319-
myString = QgsApplication::developerPath() + myString + QString( ".jpg" );
320-
#ifdef QGISDEBUG
321-
printf( "Loading mug: %s\n", myString.toLocal8Bit().constData() );
322-
#endif
323-
324-
/* Uncomment this block to use preloaded images
325-
pixAuthorMug->setPixmap(mugs[myString]);
326-
*/
327-
}
328-
329318
void QgsAbout::on_btnQgisUser_clicked()
330319
{
331320
// find a browser

‎src/app/qgsabout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class QgsAbout : public QDialog, private Ui::QgsAbout
3737

3838
private slots:
3939
void on_buttonCancel_clicked();
40-
void on_listBox1_currentItemChanged( QListWidgetItem *theItem );
4140
void on_btnQgisUser_clicked();
4241
void on_btnQgisHome_clicked();
4342
};

‎src/core/qgsapplication.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ const QString QgsApplication::authorsFilePath()
161161
{
162162
return mPkgDataPath + QString( "/doc/AUTHORS" );
163163
}
164+
/*!
165+
Returns the path to the contributors file.
166+
*/
167+
const QString QgsApplication::contributorsFilePath()
168+
{
169+
return mPkgDataPath + QString( "/doc/CONTRIBUTORS" );
170+
}
164171
/*!
165172
Returns the path to the sponsors file.
166173
*/

‎src/core/qgsapplication.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ class CORE_EXPORT QgsApplication: public QApplication
5454
//! Returns the path to the authors file.
5555
static const QString authorsFilePath();
5656

57+
/** Returns the path to the contributors file.
58+
* Contributors are people who have submitted patches
59+
* but dont have svn write access.
60+
* @note this function was added in version 1.3 */
61+
static const QString contributorsFilePath();
62+
5763
/**Returns the path to the sponsors file.
5864
@note this function was added in version 1.2*/
5965
static const QString sponsorsFilePath();

0 commit comments

Comments
 (0)