Skip to content

Commit

Permalink
make update_ts_files.sh less noisy and a bit more failsafe and fix a …
Browse files Browse the repository at this point in the history
…bunch or lupdate warnings

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13370 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 24, 2010
1 parent b759fd7 commit 071ab66
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 31 deletions.
4 changes: 2 additions & 2 deletions scripts/qgm2cpp.pl
Expand Up @@ -46,10 +46,10 @@ sub parse {

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

Expand Down
66 changes: 48 additions & 18 deletions scripts/update_ts_files.sh
Expand Up @@ -5,16 +5,50 @@
# 3. remove the .pro
# Note the .pro file must NOT be named qgis.pro as this
# name is reserved for the Windows qmake project file
# update_ts_files.sh,v 1.3 2004/07/14 18:16:24 gsherman Exp
# $Id$

set -e

cleanup() {
if [ -f i18n/qt_ts.tar ]; then
echo Restoring Qt translations
tar -xf i18n/qt_ts.tar
fi
if [ -f i18n/qgis_ts.tar ]; then
echo Restoring excluded translations
tar -xf i18n/qgis_ts.tar
fi

echo Removing temporary files
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
for i in \
python/python-i18n.{ts,cpp} \
python/plugins/*/python-i18n.{ts,cpp} \
i18n/qgis_*.ts.bak \
src/plugins/grass/grasslabels-i18n.cpp \
i18n/qt_ts.tar \
i18n/qgis_ts.tar \
qgis_ts.pro
do
[ -f "$i" ] && rm "$i"
done

for i in \
src/plugins/plugin_template/plugingui.cpp \
src/plugins/plugin_template/plugin.cpp
do
[ -f "$i.save" ] && mv "$i.save" "$i"
done
}

trap cleanup EXIT

PATH=$QTDIR/bin:$PATH

#first tar the qt_xx.ts files in i18n folder such that lupdate does not
#merge the qgis strings to them
echo Creating qt_ts.tar
tar --remove-files -cvf i18n/qt_ts.tar i18n/qt_*.ts
echo Saving Qt translations
tar --remove-files -cf i18n/qt_ts.tar i18n/qt_*.ts
exclude=
opts=
for i in "$@"; do
Expand All @@ -25,7 +59,8 @@ for i in "$@"; do
fi
done
if [ -n "$exclude" ]; then
tar --remove-files -cvf i18n/qgis_ts.tar i18n/qgis_*.ts$exclude
echo Saving excluded translations
tar --remove-files -cf i18n/qgis_ts.tar i18n/qgis_*.ts$exclude
fi
echo Updating python translations
cd python
Expand All @@ -40,21 +75,16 @@ for i in python/plugins/*/CMakeLists.txt; do
rm python-i18n.ts
cd ../../..
done
echo Updating GRASS module translations
perl scripts/qgm2cpp.pl >src/plugins/grass/grasslabels-i18n.cpp
mv src/plugins/plugin_template/plugingui.cpp src/plugins/plugin_template/plugingui.cpp.save
echo Creating qmake project file
for i in \
src/plugins/plugin_template/plugingui.cpp \
src/plugins/plugin_template/plugin.cpp
do
[ -f "$i" ] && mv "$i" "$i.save"
done
qmake -project -o qgis_ts.pro -nopwd src python i18n
echo Updating translation files
echo Updating translations
lupdate$opts -verbose qgis_ts.pro
echo Removing temporary python translation files
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
rm python/python-i18n.cpp python/plugins/*/python-i18n.cpp i18n/qgis_*.ts.bak src/plugins/grass/grasslabels-i18n.cpp
echo Removing qmake project file
rm qgis_ts.pro
echo Unpacking qt_ts.tar
tar -xvf i18n/qt_ts.tar
rm i18n/qt_ts.tar
if [ -f i18n/qgis_ts.tar ]; then
echo Unpacking i18n/qgis_ts.tar
tar -xvf i18n/qgis_ts.tar
rm i18n/qgis_ts.tar
fi
3 changes: 3 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -131,6 +131,7 @@ SET (QGIS_APP_MOC_HDRS
qgisappinterface.h
qgsabout.h
qgsaddattrdialog.h
qgsdisplayangle.h
qgsannotationwidget.h
qgsattributeactiondialog.h
qgsattributedialog.h
Expand Down Expand Up @@ -160,6 +161,8 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptooladdring.h
qgsmaptoolmovefeature.h
qgsmaptoolnodetool.h
qgsmaptoolreshape.h
qgsmaptoolrotatepointsymbols.h
qgsmaptoolselect.h
qgsmaptooladdvertex.h
qgsmaptooldeletering.h
Expand Down
2 changes: 2 additions & 0 deletions src/app/attributetable/qgsattributetableview.h
Expand Up @@ -28,6 +28,8 @@ class QMenu;

class QgsAttributeTableView: public QTableView
{
Q_OBJECT

public:
QgsAttributeTableView( QWidget* parent = NULL );
virtual ~QgsAttributeTableView();
Expand Down
1 change: 0 additions & 1 deletion src/app/composer/qgscomposermanager.cpp
Expand Up @@ -211,7 +211,6 @@ void QgsComposerManager::show_clicked()
raise();
activateWindow();
}
}
#endif //0
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsdisplayangle.h
Expand Up @@ -21,6 +21,8 @@
/**A class that displays results of angle measurements with the proper unit*/
class QgsDisplayAngle: public QDialog, private Ui::QgsDisplayAngleBase
{
Q_OBJECT

public:
QgsDisplayAngle( QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsDisplayAngle();
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsmaptoolreshape.h
Expand Up @@ -22,6 +22,8 @@
/**A map tool that draws a line and splits the features cut by the line*/
class QgsMapToolReshape: public QgsMapToolCapture
{
Q_OBJECT

public:
QgsMapToolReshape( QgsMapCanvas* canvas );
virtual ~QgsMapToolReshape();
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsmaptoolrotatepointsymbols.h
Expand Up @@ -24,6 +24,8 @@ class QgsPointRotationItem;
/**A class that allows to interactively manipulate the value of the rotation field(s) for point layers*/
class QgsMapToolRotatePointSymbols: public QgsMapToolEdit
{
Q_OBJECT

public:
QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas );
~QgsMapToolRotatePointSymbols();
Expand Down
1 change: 1 addition & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -71,6 +71,7 @@ symbology-ng/qgsvectorgradientcolorrampv2dialog.h
symbology-ng/qgsvectorrandomcolorrampv2dialog.h
symbology-ng/qgsvectorcolorbrewercolorrampv2dialog.h
symbology-ng/characterwidget.h
symbology-ng/qgspenstylecombobox.h

qgsattributeeditor.h
qgscomposerview.h
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgscredentialdialog.h
Expand Up @@ -20,7 +20,6 @@

#include <ui_qgscredentialdialog.h>
#include <qgisgui.h>
#include "qgscredentialdialog.h"
#include "qgscredentials.h"

#include <QString>
Expand Down
6 changes: 6 additions & 0 deletions src/gui/symbology-ng/qgspenstylecombobox.h
Expand Up @@ -6,6 +6,8 @@

class GUI_EXPORT QgsPenStyleComboBox : public QComboBox
{
Q_OBJECT

public:
QgsPenStyleComboBox( QWidget* parent = NULL );

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

class GUI_EXPORT QgsPenJoinStyleComboBox : public QComboBox
{
Q_OBJECT

public:
QgsPenJoinStyleComboBox( QWidget* parent = NULL );

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

class GUI_EXPORT QgsPenCapStyleComboBox : public QComboBox
{
Q_OBJECT

public:
QgsPenCapStyleComboBox( QWidget* parent = NULL );

Expand Down
2 changes: 0 additions & 2 deletions src/plugins/evis/databaseconnection/evisdatabaseconnection.h
Expand Up @@ -28,8 +28,6 @@
#ifndef EVISDATABASECONNECTION_H
#define EVISDATABASECONNECTION_H

#include "evisquerydefinition.h"

#include <QStringList>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -43,6 +43,7 @@
#include <QMessageBox>
#include <QSettings>
#include <QToolBar>
#include <QDebug>

extern "C"
{
Expand Down Expand Up @@ -116,7 +117,6 @@ QWidget *QgsGrassEditAttributeTableItemDelegate::createEditor( QWidget *parent,
return editor;
}

#include<QDebug>
void QgsGrassEditAttributeTableItemDelegate::setEditorData( QWidget *editor,
const QModelIndex &index ) const
{
Expand Down Expand Up @@ -894,8 +894,8 @@ int QgsGrassEdit::lineSymbFromMap( int line )

/* Count areas on both sides */
nareas = 0;
if ( left > 0 || (left < 0 && mProvider->isleArea(-left) > 0 ) ) nareas++;
if ( right > 0 || (right < 0 && mProvider->isleArea(-right) > 0 ) ) nareas++;
if ( left > 0 || ( left < 0 && mProvider->isleArea( -left ) > 0 ) ) nareas++;
if ( right > 0 || ( right < 0 && mProvider->isleArea( -right ) > 0 ) ) nareas++;
if ( nareas == 0 ) return SYMB_BOUNDARY_0;
else if ( nareas == 1 ) return SYMB_BOUNDARY_1;
else return SYMB_BOUNDARY_2;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/grass/CMakeLists.txt
Expand Up @@ -24,8 +24,8 @@ INCLUDE_DIRECTORIES (
${GEOS_INCLUDE_DIR}
)


ADD_LIBRARY (qgisgrass SHARED ${GRASS_LIB_SRCS})
QT4_WRAP_CPP(GRASS_MOC_SRCS qgsgrassprovider.h)
ADD_LIBRARY (qgisgrass SHARED ${GRASS_LIB_SRCS} ${GRASS_MOC_SRCS})

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

Expand Down
4 changes: 3 additions & 1 deletion src/providers/grass/qgsgrassprovider.h
Expand Up @@ -110,6 +110,8 @@ struct GMAP
*/
class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
{
Q_OBJECT

public:

QgsGrassProvider( QString uri = QString() );
Expand Down Expand Up @@ -282,7 +284,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider

/** Get isle area
* @param isle number
* @return area number
* @return area number
*/
int isleArea( int isle );

Expand Down
3 changes: 2 additions & 1 deletion src/providers/memory/CMakeLists.txt
Expand Up @@ -7,7 +7,8 @@ INCLUDE_DIRECTORIES(
${GEOS_INCLUDE_DIR}
)

ADD_LIBRARY(memoryprovider MODULE ${MEMORY_SRCS})
QT4_WRAP_CPP(MEMORY_MOC_SRCS qgsmemoryprovider.h)
ADD_LIBRARY(memoryprovider MODULE ${MEMORY_SRCS} ${MEMORY_MOC_SRCS})

TARGET_LINK_LIBRARIES(memoryprovider
qgis_core
Expand Down
2 changes: 2 additions & 0 deletions src/providers/memory/qgsmemoryprovider.h
Expand Up @@ -22,6 +22,8 @@ class QgsSpatialIndex;

class QgsMemoryProvider : public QgsVectorDataProvider
{
Q_OBJECT

public:
QgsMemoryProvider( QString uri = QString() );

Expand Down

0 comments on commit 071ab66

Please sign in to comment.