Skip to content

Commit 071ab66

Browse files
author
jef
committed
make update_ts_files.sh less noisy and a bit more failsafe and fix a bunch or lupdate warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13370 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b759fd7 commit 071ab66

17 files changed

+80
-31
lines changed

scripts/qgm2cpp.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ sub parse {
4646

4747
open I, "find src/plugins/grass -name '*.qgm' -o -name '*.qgc'|";
4848
while($file = <I>) {
49-
print STDERR "$file\n";
49+
#print STDERR "$file\n";
5050
chop $file;
5151
parse XMLin($file, ForceArray=>1);
52-
print STDERR "$file DONE\n";
52+
#print STDERR "$file DONE\n";
5353
}
5454
close I;
5555

scripts/update_ts_files.sh

+48-18
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,50 @@
55
# 3. remove the .pro
66
# Note the .pro file must NOT be named qgis.pro as this
77
# name is reserved for the Windows qmake project file
8-
# update_ts_files.sh,v 1.3 2004/07/14 18:16:24 gsherman Exp
8+
# $Id$
99

1010
set -e
1111

12+
cleanup() {
13+
if [ -f i18n/qt_ts.tar ]; then
14+
echo Restoring Qt translations
15+
tar -xf i18n/qt_ts.tar
16+
fi
17+
if [ -f i18n/qgis_ts.tar ]; then
18+
echo Restoring excluded translations
19+
tar -xf i18n/qgis_ts.tar
20+
fi
21+
22+
echo Removing temporary files
23+
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
24+
for i in \
25+
python/python-i18n.{ts,cpp} \
26+
python/plugins/*/python-i18n.{ts,cpp} \
27+
i18n/qgis_*.ts.bak \
28+
src/plugins/grass/grasslabels-i18n.cpp \
29+
i18n/qt_ts.tar \
30+
i18n/qgis_ts.tar \
31+
qgis_ts.pro
32+
do
33+
[ -f "$i" ] && rm "$i"
34+
done
35+
36+
for i in \
37+
src/plugins/plugin_template/plugingui.cpp \
38+
src/plugins/plugin_template/plugin.cpp
39+
do
40+
[ -f "$i.save" ] && mv "$i.save" "$i"
41+
done
42+
}
43+
44+
trap cleanup EXIT
45+
1246
PATH=$QTDIR/bin:$PATH
1347

1448
#first tar the qt_xx.ts files in i18n folder such that lupdate does not
1549
#merge the qgis strings to them
16-
echo Creating qt_ts.tar
17-
tar --remove-files -cvf i18n/qt_ts.tar i18n/qt_*.ts
50+
echo Saving Qt translations
51+
tar --remove-files -cf i18n/qt_ts.tar i18n/qt_*.ts
1852
exclude=
1953
opts=
2054
for i in "$@"; do
@@ -25,7 +59,8 @@ for i in "$@"; do
2559
fi
2660
done
2761
if [ -n "$exclude" ]; then
28-
tar --remove-files -cvf i18n/qgis_ts.tar i18n/qgis_*.ts$exclude
62+
echo Saving excluded translations
63+
tar --remove-files -cf i18n/qgis_ts.tar i18n/qgis_*.ts$exclude
2964
fi
3065
echo Updating python translations
3166
cd python
@@ -40,21 +75,16 @@ for i in python/plugins/*/CMakeLists.txt; do
4075
rm python-i18n.ts
4176
cd ../../..
4277
done
78+
echo Updating GRASS module translations
4379
perl scripts/qgm2cpp.pl >src/plugins/grass/grasslabels-i18n.cpp
80+
mv src/plugins/plugin_template/plugingui.cpp src/plugins/plugin_template/plugingui.cpp.save
4481
echo Creating qmake project file
82+
for i in \
83+
src/plugins/plugin_template/plugingui.cpp \
84+
src/plugins/plugin_template/plugin.cpp
85+
do
86+
[ -f "$i" ] && mv "$i" "$i.save"
87+
done
4588
qmake -project -o qgis_ts.pro -nopwd src python i18n
46-
echo Updating translation files
89+
echo Updating translations
4790
lupdate$opts -verbose qgis_ts.pro
48-
echo Removing temporary python translation files
49-
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
50-
rm python/python-i18n.cpp python/plugins/*/python-i18n.cpp i18n/qgis_*.ts.bak src/plugins/grass/grasslabels-i18n.cpp
51-
echo Removing qmake project file
52-
rm qgis_ts.pro
53-
echo Unpacking qt_ts.tar
54-
tar -xvf i18n/qt_ts.tar
55-
rm i18n/qt_ts.tar
56-
if [ -f i18n/qgis_ts.tar ]; then
57-
echo Unpacking i18n/qgis_ts.tar
58-
tar -xvf i18n/qgis_ts.tar
59-
rm i18n/qgis_ts.tar
60-
fi

src/app/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ SET (QGIS_APP_MOC_HDRS
131131
qgisappinterface.h
132132
qgsabout.h
133133
qgsaddattrdialog.h
134+
qgsdisplayangle.h
134135
qgsannotationwidget.h
135136
qgsattributeactiondialog.h
136137
qgsattributedialog.h
@@ -160,6 +161,8 @@ SET (QGIS_APP_MOC_HDRS
160161
qgsmaptooladdring.h
161162
qgsmaptoolmovefeature.h
162163
qgsmaptoolnodetool.h
164+
qgsmaptoolreshape.h
165+
qgsmaptoolrotatepointsymbols.h
163166
qgsmaptoolselect.h
164167
qgsmaptooladdvertex.h
165168
qgsmaptooldeletering.h

src/app/attributetable/qgsattributetableview.h

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class QMenu;
2828

2929
class QgsAttributeTableView: public QTableView
3030
{
31+
Q_OBJECT
32+
3133
public:
3234
QgsAttributeTableView( QWidget* parent = NULL );
3335
virtual ~QgsAttributeTableView();

src/app/composer/qgscomposermanager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ void QgsComposerManager::show_clicked()
211211
raise();
212212
activateWindow();
213213
}
214-
}
215214
#endif //0
216215
}
217216

src/app/qgsdisplayangle.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
/**A class that displays results of angle measurements with the proper unit*/
2222
class QgsDisplayAngle: public QDialog, private Ui::QgsDisplayAngleBase
2323
{
24+
Q_OBJECT
25+
2426
public:
2527
QgsDisplayAngle( QWidget * parent = 0, Qt::WindowFlags f = 0 );
2628
~QgsDisplayAngle();

src/app/qgsmaptoolreshape.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
/**A map tool that draws a line and splits the features cut by the line*/
2323
class QgsMapToolReshape: public QgsMapToolCapture
2424
{
25+
Q_OBJECT
26+
2527
public:
2628
QgsMapToolReshape( QgsMapCanvas* canvas );
2729
virtual ~QgsMapToolReshape();

src/app/qgsmaptoolrotatepointsymbols.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class QgsPointRotationItem;
2424
/**A class that allows to interactively manipulate the value of the rotation field(s) for point layers*/
2525
class QgsMapToolRotatePointSymbols: public QgsMapToolEdit
2626
{
27+
Q_OBJECT
28+
2729
public:
2830
QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas );
2931
~QgsMapToolRotatePointSymbols();

src/gui/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ symbology-ng/qgsvectorgradientcolorrampv2dialog.h
7171
symbology-ng/qgsvectorrandomcolorrampv2dialog.h
7272
symbology-ng/qgsvectorcolorbrewercolorrampv2dialog.h
7373
symbology-ng/characterwidget.h
74+
symbology-ng/qgspenstylecombobox.h
7475

7576
qgsattributeeditor.h
7677
qgscomposerview.h

src/gui/qgscredentialdialog.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <ui_qgscredentialdialog.h>
2222
#include <qgisgui.h>
23-
#include "qgscredentialdialog.h"
2423
#include "qgscredentials.h"
2524

2625
#include <QString>

src/gui/symbology-ng/qgspenstylecombobox.h

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
class GUI_EXPORT QgsPenStyleComboBox : public QComboBox
88
{
9+
Q_OBJECT
10+
911
public:
1012
QgsPenStyleComboBox( QWidget* parent = NULL );
1113

@@ -20,6 +22,8 @@ class GUI_EXPORT QgsPenStyleComboBox : public QComboBox
2022

2123
class GUI_EXPORT QgsPenJoinStyleComboBox : public QComboBox
2224
{
25+
Q_OBJECT
26+
2327
public:
2428
QgsPenJoinStyleComboBox( QWidget* parent = NULL );
2529

@@ -30,6 +34,8 @@ class GUI_EXPORT QgsPenJoinStyleComboBox : public QComboBox
3034

3135
class GUI_EXPORT QgsPenCapStyleComboBox : public QComboBox
3236
{
37+
Q_OBJECT
38+
3339
public:
3440
QgsPenCapStyleComboBox( QWidget* parent = NULL );
3541

src/plugins/evis/databaseconnection/evisdatabaseconnection.h

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#ifndef EVISDATABASECONNECTION_H
2929
#define EVISDATABASECONNECTION_H
3030

31-
#include "evisquerydefinition.h"
32-
3331
#include <QStringList>
3432
#include <QtSql/QSqlDatabase>
3533
#include <QtSql/QSqlQuery>

src/plugins/grass/qgsgrassedit.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <QMessageBox>
4444
#include <QSettings>
4545
#include <QToolBar>
46+
#include <QDebug>
4647

4748
extern "C"
4849
{
@@ -116,7 +117,6 @@ QWidget *QgsGrassEditAttributeTableItemDelegate::createEditor( QWidget *parent,
116117
return editor;
117118
}
118119

119-
#include<QDebug>
120120
void QgsGrassEditAttributeTableItemDelegate::setEditorData( QWidget *editor,
121121
const QModelIndex &index ) const
122122
{
@@ -894,8 +894,8 @@ int QgsGrassEdit::lineSymbFromMap( int line )
894894

895895
/* Count areas on both sides */
896896
nareas = 0;
897-
if ( left > 0 || (left < 0 && mProvider->isleArea(-left) > 0 ) ) nareas++;
898-
if ( right > 0 || (right < 0 && mProvider->isleArea(-right) > 0 ) ) nareas++;
897+
if ( left > 0 || ( left < 0 && mProvider->isleArea( -left ) > 0 ) ) nareas++;
898+
if ( right > 0 || ( right < 0 && mProvider->isleArea( -right ) > 0 ) ) nareas++;
899899
if ( nareas == 0 ) return SYMB_BOUNDARY_0;
900900
else if ( nareas == 1 ) return SYMB_BOUNDARY_1;
901901
else return SYMB_BOUNDARY_2;

src/providers/grass/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ INCLUDE_DIRECTORIES (
2424
${GEOS_INCLUDE_DIR}
2525
)
2626

27-
28-
ADD_LIBRARY (qgisgrass SHARED ${GRASS_LIB_SRCS})
27+
QT4_WRAP_CPP(GRASS_MOC_SRCS qgsgrassprovider.h)
28+
ADD_LIBRARY (qgisgrass SHARED ${GRASS_LIB_SRCS} ${GRASS_MOC_SRCS})
2929

3030
SET_TARGET_PROPERTIES(qgisgrass PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION})
3131

src/providers/grass/qgsgrassprovider.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ struct GMAP
110110
*/
111111
class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
112112
{
113+
Q_OBJECT
114+
113115
public:
114116

115117
QgsGrassProvider( QString uri = QString() );
@@ -282,7 +284,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
282284

283285
/** Get isle area
284286
* @param isle number
285-
* @return area number
287+
* @return area number
286288
*/
287289
int isleArea( int isle );
288290

src/providers/memory/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ INCLUDE_DIRECTORIES(
77
${GEOS_INCLUDE_DIR}
88
)
99

10-
ADD_LIBRARY(memoryprovider MODULE ${MEMORY_SRCS})
10+
QT4_WRAP_CPP(MEMORY_MOC_SRCS qgsmemoryprovider.h)
11+
ADD_LIBRARY(memoryprovider MODULE ${MEMORY_SRCS} ${MEMORY_MOC_SRCS})
1112

1213
TARGET_LINK_LIBRARIES(memoryprovider
1314
qgis_core

src/providers/memory/qgsmemoryprovider.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class QgsSpatialIndex;
2222

2323
class QgsMemoryProvider : public QgsVectorDataProvider
2424
{
25+
Q_OBJECT
26+
2527
public:
2628
QgsMemoryProvider( QString uri = QString() );
2729

0 commit comments

Comments
 (0)