Commit 9783d25e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to KLazyLocalizedString

parent a579d363
Pipeline #203476 passed with stage
in 10 minutes and 46 seconds
......@@ -34,6 +34,7 @@
#include <KCursor>
#include <QDebug>
#include <KMessageBox>
#include <KLazyLocalizedString>
#include <algorithm>
#include <functional>
......@@ -155,11 +156,11 @@ void TextLabelModeBase::leftReleased( QMouseEvent* e, KigWidget* v,
p.setObjectName( QStringLiteral("text_label_select_arg_popup") );
QAction* act = p.addAction( i18n( "Name" ) );
act->setData( QVariant::fromValue( 0 ) );
QByteArrayList l = o->imp()->properties();
QList<KLazyLocalizedString> l = o->imp()->properties();
assert( l.size() == o->imp()->numberOfProperties() );
for ( int i = 0; i < l.size(); ++i )
{
QString s = i18n( l[i] );
QString s = l[i].toString();
const char* iconfile = o->imp()->iconForProperty( i );
if ( iconfile && *iconfile )
{
......
......@@ -19,6 +19,7 @@
#include <QIcon>
#include <KIconEngine>
#include <KLazyLocalizedString>
void PropertiesActionsProvider::fillUpMenu( NormalModePopupObjects& popup,
int menu, int& nextfree )
......@@ -50,11 +51,11 @@ void PropertiesActionsProvider::fillUpMenu( NormalModePopupObjects& popup,
{
if ( iconfile && *iconfile )
{
popup.addInternalAction( menu, QIcon( new KIconEngine( iconfile, popup.part().iconLoader() ) ), i18n( o->imp()->properties()[i] ), nextfree++ );
popup.addInternalAction( menu, QIcon( new KIconEngine( iconfile, popup.part().iconLoader() ) ), o->imp()->properties()[i].toString(), nextfree++ );
}
else
{
popup.addInternalAction( menu, i18n( o->imp()->properties()[i] ), nextfree++ );
popup.addInternalAction( menu, o->imp()->properties()[i].toString(), nextfree++ );
};
mprops[menu-1].push_back( i );
};
......
......@@ -18,6 +18,8 @@
#include "../kig/kig_document.h"
#include "../kig/kig_view.h"
#include <KLazyLocalizedString>
#include <cmath>
//#include <gsl/gsl_poly.h>
......@@ -115,12 +117,12 @@ const QByteArrayList BezierImp::propertiesInternalNames() const
return l;
}
const QByteArrayList BezierImp::properties() const
const QList<KLazyLocalizedString> BezierImp::properties() const
{
QByteArrayList l = Parent::properties();
l += I18N_NOOP( "Number of control points" );
l += I18N_NOOP( "Control polygon" );
l += I18N_NOOP( "Cartesian Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l += kli18n( "Number of control points" );
l += kli18n( "Control polygon" );
l += kli18n( "Cartesian Equation" );
assert( l.size() == BezierImp::numberOfProperties() );
return l;
}
......@@ -413,12 +415,12 @@ const QByteArrayList RationalBezierImp::propertiesInternalNames() const
return l;
}
const QByteArrayList RationalBezierImp::properties() const
const QList<KLazyLocalizedString> RationalBezierImp::properties() const
{
QByteArrayList l = Parent::properties();
l += I18N_NOOP( "Number of control points" );
l += I18N_NOOP( "Control polygon" );
l += I18N_NOOP( "Cartesian Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l += kli18n( "Number of control points" );
l += kli18n( "Control polygon" );
l += kli18n( "Cartesian Equation" );
assert( l.size() == RationalBezierImp::numberOfProperties() );
return l;
}
......
......@@ -55,7 +55,7 @@ public:
const KigDocument& doc ) const;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......@@ -126,7 +126,7 @@ public:
const KigDocument& doc ) const;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -4,6 +4,7 @@
#include "bogus_imp.h"
#include <KLazyLocalizedString>
#include <QStringList>
#include "../misc/rect.h"
......@@ -318,10 +319,10 @@ int TestResultImp::numberOfProperties() const
return Parent::numberOfProperties() + 1;
}
const QByteArrayList TestResultImp::properties() const
const QList<KLazyLocalizedString> TestResultImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Test Result" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Test Result" );
assert( l.size() == TestResultImp::numberOfProperties() );
return l;
}
......
......@@ -255,7 +255,7 @@ public:
void visit( ObjectImpVisitor* vtor ) const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& d ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -15,6 +15,7 @@
#include "../kig/kig_document.h"
#include "../kig/kig_view.h"
#include <KLazyLocalizedString>
#include <math.h>
CircleImp::CircleImp( const Coordinate& center, double radius )
......@@ -125,16 +126,16 @@ const QByteArrayList CircleImp::propertiesInternalNames() const
return l;
}
const QByteArrayList CircleImp::properties() const
const QList<KLazyLocalizedString> CircleImp::properties() const
{
QByteArrayList l = CurveImp::properties();
l << I18N_NOOP( "Surface" );
l << I18N_NOOP( "Circumference" );
l << I18N_NOOP( "Radius" );
l << I18N_NOOP( "Center" );
l << I18N_NOOP( "Expanded Cartesian Equation" );
l << I18N_NOOP( "Cartesian Equation" );
l << I18N_NOOP( "Polar Equation" );
QList<KLazyLocalizedString> l = CurveImp::properties();
l << kli18n( "Surface" );
l << kli18n( "Circumference" );
l << kli18n( "Radius" );
l << kli18n( "Center" );
l << kli18n( "Expanded Cartesian Equation" );
l << kli18n( "Cartesian Equation" );
l << kli18n( "Polar Equation" );
assert( l.size() == CircleImp::numberOfProperties() );
return l;
}
......
......@@ -7,6 +7,8 @@
#include "conic_imp.h"
#include <KLazyLocalizedString>
/**
* An ObjectImp representing a circle. This class is a subclass of
* ConicImp, ensuring that a circle can be used as a conic.
......@@ -42,7 +44,7 @@ public:
const Coordinate getPoint( double param, const KigDocument& ) const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -4,6 +4,7 @@
#include "conic_imp.h"
#include <KLazyLocalizedString>
#include <math.h>
#include "bogus_imp.h"
......@@ -64,15 +65,15 @@ const QByteArrayList ConicImp::propertiesInternalNames() const
return l;
}
const QByteArrayList ConicImp::properties() const
const QList<KLazyLocalizedString> ConicImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Conic Type" );
l << I18N_NOOP( "Center" );
l << I18N_NOOP( "First Focus" );
l << I18N_NOOP( "Second Focus" );
l << I18N_NOOP( "Cartesian Equation" );
l << I18N_NOOP( "Polar Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Conic Type" );
l << kli18n( "Center" );
l << kli18n( "First Focus" );
l << kli18n( "Second Focus" );
l << kli18n( "Cartesian Equation" );
l << kli18n( "Polar Equation" );
assert( l.size() == ConicImp::numberOfProperties() );
return l;
}
......@@ -514,12 +515,12 @@ int ConicArcImp::numberOfProperties() const
return Parent::numberOfProperties() + 3;
}
const QByteArrayList ConicArcImp::properties() const
const QList<KLazyLocalizedString> ConicArcImp::properties() const
{
QByteArrayList ret = Parent::properties();
ret << I18N_NOOP( "Supporting Conic" );
ret << I18N_NOOP( "First End Point" );
ret << I18N_NOOP( "Second End Point" );
QList<KLazyLocalizedString> ret = Parent::properties();
ret << kli18n( "Supporting Conic" );
ret << kli18n( "First End Point" );
ret << kli18n( "Second End Point" );
assert( ret.size() == ConicArcImp::numberOfProperties() );
return ret;
}
......
......@@ -46,7 +46,7 @@ public:
int numberOfProperties() const override;
const ObjectImpType* impRequirementForProperty( int which ) const override;
bool isPropertyDefinedOnOrThroughThisImp( int which ) const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
const char* iconForProperty( int which ) const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
......@@ -183,7 +183,7 @@ public:
const KigDocument& doc ) const;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -15,6 +15,7 @@
#include <math.h>
#include <QString>
#include <KLazyLocalizedString>
CubicImp::CubicImp( const CubicCartesianData& data )
: CurveImp(), mdata( data )
......@@ -273,10 +274,10 @@ const QByteArrayList CubicImp::propertiesInternalNames() const
* cartesian equation property contributed by Carlo Sardi
*/
const QByteArrayList CubicImp::properties() const
const QList<KLazyLocalizedString> CubicImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Cartesian Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Cartesian Equation" );
assert( l.size() == CubicImp::numberOfProperties() );
return l;
......
......@@ -9,6 +9,8 @@
#include "../misc/cubic-common.h"
#include <KLazyLocalizedString>
/**
* An ObjectImp representing a cubic.
......@@ -32,7 +34,7 @@ public:
QString cartesianEquationString( const KigDocument& ) const;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -14,6 +14,7 @@
#include "../misc/equationstring.h"
#include "../kig/kig_view.h"
#include <KLazyLocalizedString>
#include <cmath>
using namespace std;
......@@ -76,11 +77,11 @@ const QByteArrayList AbstractLineImp::propertiesInternalNames() const
return l;
}
const QByteArrayList AbstractLineImp::properties() const
const QList<KLazyLocalizedString> AbstractLineImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Slope" );
l << I18N_NOOP( "Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Slope" );
l << kli18n( "Equation" );
assert( l.size() == AbstractLineImp::numberOfProperties() );
return l;
}
......@@ -103,15 +104,15 @@ const QByteArrayList SegmentImp::propertiesInternalNames() const
return s;
}
const QByteArrayList SegmentImp::properties() const
const QList<KLazyLocalizedString> SegmentImp::properties() const
{
QByteArrayList s = Parent::properties();
s << I18N_NOOP( "Length" );
s << I18N_NOOP( "Mid Point" );
s << I18N_NOOP( "Golden Ratio Point" );
s << I18N_NOOP( "Support Line" );
s << I18N_NOOP( "First End Point" );
s << I18N_NOOP( "Second End Point" );
QList<KLazyLocalizedString> s = Parent::properties();
s << kli18n( "Length" );
s << kli18n( "Mid Point" );
s << kli18n( "Golden Ratio Point" );
s << kli18n( "Support Line" );
s << kli18n( "First End Point" );
s << kli18n( "Second End Point" );
assert( s.size() == SegmentImp::numberOfProperties() );
return s;
}
......@@ -180,11 +181,11 @@ const QByteArrayList RayImp::propertiesInternalNames() const
return s;
}
const QByteArrayList RayImp::properties() const
const QList<KLazyLocalizedString> RayImp::properties() const
{
QByteArrayList s = Parent::properties();
s << I18N_NOOP( "Support Line" );
s << I18N_NOOP( "End Point" );
QList<KLazyLocalizedString> s = Parent::properties();
s << kli18n( "Support Line" );
s << kli18n( "End Point" );
assert( s.size() == RayImp::numberOfProperties() );
return s;
}
......
......@@ -36,7 +36,7 @@ public:
bool inRect( const Rect& r, int width, const KigWidget& ) const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& d ) const override;
const char* iconForProperty( int which ) const override;
......@@ -95,7 +95,7 @@ public:
double getParam( const Coordinate&, const KigDocument& ) const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& d ) const override;
const char* iconForProperty( int which ) const override;
......@@ -151,7 +151,7 @@ public:
double getParam( const Coordinate&, const KigDocument& ) const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& d ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -15,6 +15,7 @@
#include "../kig/kig_view.h"
#include "../kig/kig_document.h"
#include <KLazyLocalizedString>
#include <cmath>
using namespace std;
......@@ -86,10 +87,10 @@ const QByteArrayList LocusImp::propertiesInternalNames() const
return l;
}
const QByteArrayList LocusImp::properties() const
const QList<KLazyLocalizedString> LocusImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Cartesian Equation" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Cartesian Equation" );
assert( l.size() == LocusImp::numberOfProperties() );
return l;
}
......
......@@ -66,7 +66,7 @@ public:
// TODO ?
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......
......@@ -8,6 +8,7 @@
#include "../misc/coordinate.h"
#include <KLazyLocalizedString>
#include <map>
class ObjectImpType::StaticPrivate
......@@ -34,10 +35,10 @@ void ObjectImp::fillInNextEscape( QString&, const KigDocument& ) const
assert( false );
}
const QByteArrayList ObjectImp::properties() const
const QList<KLazyLocalizedString> ObjectImp::properties() const
{
QByteArrayList ret;
ret << I18N_NOOP( "Object Type" );
QList<KLazyLocalizedString> ret;
ret << kli18n( "Object Type" );
return ret;
}
......
......@@ -7,6 +7,8 @@
#include "common.h"
#include <KLazyLocalizedString>
class IntImp;
class DoubleImp;
class StringImp;
......@@ -323,7 +325,7 @@ public:
virtual int numberOfProperties() const;
// the names of the properties as perceived by the user.. put
// I18N_NOOP's around them here..
virtual const QByteArrayList properties() const;
virtual const QList<KLazyLocalizedString> properties() const;
// the names of the properties as known only by kig internally. No
// need for I18N_NOOP. Preferably choose some lowercase name with
// only letters and dashes, no spaces..
......
......@@ -112,12 +112,12 @@ const QByteArrayList AngleImp::propertiesInternalNames() const
return l;
}
const QByteArrayList AngleImp::properties() const
const QList<KLazyLocalizedString> AngleImp::properties() const
{
QByteArrayList l = Parent::properties();
l << I18N_NOOP( "Angle in Radians" );
l << I18N_NOOP( "Angle in Degrees" );
l << I18N_NOOP( "Angle Bisector" );
QList<KLazyLocalizedString> l = Parent::properties();
l << kli18n( "Angle in Radians" );
l << kli18n( "Angle in Degrees" );
l << kli18n( "Angle Bisector" );
assert( l.size() == AngleImp::numberOfProperties() );
return l;
}
......@@ -222,14 +222,14 @@ const QByteArrayList VectorImp::propertiesInternalNames() const
return ret;
}
const QByteArrayList VectorImp::properties() const
const QList<KLazyLocalizedString> VectorImp::properties() const
{
QByteArrayList ret = Parent::properties();
ret << I18N_NOOP( "Length" );
ret << I18N_NOOP( "Midpoint" );
ret << I18N_NOOP( "X length" );
ret << I18N_NOOP( "Y length" );
ret << I18N_NOOP( "Opposite Vector" );
QList<KLazyLocalizedString> ret = Parent::properties();
ret << kli18n( "Length" );
ret << kli18n( "Midpoint" );
ret << kli18n( "X length" );
ret << kli18n( "Y length" );
ret << kli18n( "Opposite Vector" );
assert( ret.size() == VectorImp::numberOfProperties() );
return ret;
}
......@@ -384,19 +384,19 @@ int ArcImp::numberOfProperties() const
return Parent::numberOfProperties() + 10;
}
const QByteArrayList ArcImp::properties() const
const QList<KLazyLocalizedString> ArcImp::properties() const
{
QByteArrayList ret = Parent::properties();
ret << I18N_NOOP( "Center" );
ret << I18N_NOOP( "Radius" );
ret << I18N_NOOP( "Angle" );
ret << I18N_NOOP( "Angle in Degrees" );
ret << I18N_NOOP( "Angle in Radians" );
ret << I18N_NOOP( "Sector Surface" );
ret << I18N_NOOP( "Arc Length" );
ret << I18N_NOOP( "Support Circle" );
ret << I18N_NOOP( "First End Point" );
ret << I18N_NOOP( "Second End Point" );
QList<KLazyLocalizedString> ret = Parent::properties();
ret << kli18n( "Center" );
ret << kli18n( "Radius" );
ret << kli18n( "Angle" );
ret << kli18n( "Angle in Degrees" );
ret << kli18n( "Angle in Radians" );
ret << kli18n( "Sector Surface" );
ret << kli18n( "Arc Length" );
ret << kli18n( "Support Circle" );
ret << kli18n( "First End Point" );
ret << kli18n( "Second End Point" );
assert( ret.size() == ArcImp::numberOfProperties() );
return ret;
}
......
......@@ -44,7 +44,7 @@ public:
Coordinate attachPoint() const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......@@ -111,7 +111,7 @@ public:
Rect surroundingRect() const override;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& w ) const override;
const char* iconForProperty( int which ) const override;
......@@ -185,7 +185,7 @@ public:
bool valid() const;
int numberOfProperties() const override;
const QByteArrayList properties() const override;
const QList<KLazyLocalizedString> properties() const override;
const QByteArrayList propertiesInternalNames() const override;
ObjectImp* property( int which, const KigDocument& d ) const override;
const char* iconForProperty( int which ) const override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment