Hello community, here is the log from the commit of package kig for openSUSE:Factory checked in at 2015-06-04 11:23:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kig (Old) and /work/SRC/openSUSE:Factory/.kig.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kig" Changes: -------- --- /work/SRC/openSUSE:Factory/kig/kig.changes 2015-05-15 10:04:43.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kig.new/kig.changes 2015-06-04 11:23:33.000000000 +0200 @@ -1,0 +2,8 @@ +Sat May 30 14:59:14 UTC 2015 - [email protected] + +- Update to KDE Applications 15.04.2 + * KDE Applications 15.04.2 + * https://www.kde.org/announcements/announce-applications-15.04.2.php + + +------------------------------------------------------------------- Old: ---- kig-15.04.1.tar.xz New: ---- kig-15.04.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kig.spec ++++++ --- /var/tmp/diff_new_pack.UKofnl/_old 2015-06-04 11:23:33.000000000 +0200 +++ /var/tmp/diff_new_pack.UKofnl/_new 2015-06-04 11:23:33.000000000 +0200 @@ -17,7 +17,7 @@ Name: kig -Version: 15.04.1 +Version: 15.04.2 Release: 0 Summary: Interactive Geometry License: GPL-2.0+ ++++++ kig-15.04.1.tar.xz -> kig-15.04.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kig-15.04.1/misc/coordinate_system.cpp new/kig-15.04.2/misc/coordinate_system.cpp --- old/kig-15.04.1/misc/coordinate_system.cpp 2015-04-27 13:13:39.000000000 +0200 +++ new/kig-15.04.2/misc/coordinate_system.cpp 2015-05-27 05:50:05.000000000 +0200 @@ -53,26 +53,44 @@ class CoordinateValidator : public QValidator { - bool mpolar; - QDoubleValidator mdv; - mutable QRegExp mre; public: + enum CoordinateType + { + Euclidean, + Polar + }; + static const char reEuclidean[]; static const char rePolar[]; - CoordinateValidator( bool polar ); + CoordinateValidator( CoordinateType type ); ~CoordinateValidator(); State validate ( QString & input, int & pos ) const; void fixup ( QString & input ) const; + +private: + CoordinateType mtype; + QDoubleValidator mdv; + mutable QRegExp mre; }; const char CoordinateValidator::reEuclidean[] = "\\s*\\(?\\s*([0-9.,+-]+)\\s*;\\s*([0-9.,+-]+)\\s*\\)?\\s*"; const char CoordinateValidator::rePolar[] = "\\s*\\(?\\s*([0-9.,+-]+)\\s*;\\s*([0-9.,+-]+) ?°?\\s*\\)?\\s*"; -CoordinateValidator::CoordinateValidator( bool polar ) - : QValidator( 0L ), mpolar( polar ), mdv( 0L ), - mre( QString::fromUtf8( polar ? rePolar : reEuclidean ) ) +CoordinateValidator::CoordinateValidator( CoordinateType type ) + : QValidator( 0L ), mtype( type ), mdv( 0L ) { + switch ( mtype ) + { + case Euclidean: + mre.setPattern( QString::fromUtf8( reEuclidean ) ); + break; + case Polar: + mre.setPattern( QString::fromUtf8( rePolar ) ); + break; + default: + break; + } } CoordinateValidator::~CoordinateValidator() @@ -85,7 +103,7 @@ if ( tinput.isEmpty() ) return Invalid; if ( tinput.at( tinput.length() - 1 ) == ')' ) tinput.truncate( tinput.length() - 1 ); - if ( mpolar ) + if ( mtype ) { // strip the eventual '°' if ( !tinput.isEmpty() && tinput.at( tinput.length() - 1 ).unicode() == 176 ) @@ -127,13 +145,20 @@ { sc = input.length(); KLocale* l = KLocale::global(); - if ( mpolar ) + switch ( mtype ) + { + case Polar: input.append( QString::fromLatin1( ";" ) + l->positiveSign() + QString::fromLatin1( "0" ) ); - else + break; + case Euclidean: input.append( QString::fromLatin1( ";" ) + l->positiveSign() + QString::fromLatin1( "0" ) + l->decimalSymbol() + QString::fromLatin1( "0" ) ); + break; + default: + break; + } }; mre.exactMatch( input ); QString ds1 = mre.cap( 1 ); @@ -159,14 +184,14 @@ return QString::fromLatin1( "( %1; %2 )" ).arg( xs ).arg( ys ); } -Coordinate EuclideanCoords::toScreen(const QString& s, bool& ok) const +Coordinate EuclideanCoords::toScreen( const QString& s, bool& ok ) const { QRegExp r( QString::fromUtf8( CoordinateValidator::reEuclidean ) ); - ok = ( r.indexIn(s) == 0 ); - if (ok) + ok = ( r.indexIn( s ) == 0 ); + if ( ok ) { - QString xs = r.cap(1); - QString ys = r.cap(2); + QString xs = r.cap( 1 ); + QString ys = r.cap( 2 ); KLocale* l = KLocale::global(); double x = l->readNumber( xs, &ok ); if ( ! ok ) x = xs.toDouble( &ok ); @@ -188,7 +213,7 @@ */ static double nicenum( double x, bool round ) { - int exp = (int) log10( x ); + int exp = ( int ) log10( x ); double f = x/pow( 10., exp ); double nf; if ( round ) @@ -229,7 +254,7 @@ // the number of intervals we would like to have: // we try to have one of them per 40 pixels or so.. const int ntick = static_cast<int>( - kigMax( hmax - hmin, vmax - vmin ) / p.pixelWidth() / 40. ) + 1; + kigMax( hmax - hmin, vmax - vmin ) / p.pixelWidth() / 40. ) + 1; double hrange = nicenum( hmax - hmin, false ); double vrange = nicenum( vmax - vmin, false ); @@ -240,13 +265,13 @@ const double hd = nicenum( hrange / ( ntick - 1 ), true ); const double vd = nicenum( vrange / ( ntick - 1 ), true ); - const double hgraphmin = ceil( hmin / hd) * hd; + const double hgraphmin = ceil( hmin / hd ) * hd; const double hgraphmax = floor( hmax / hd ) * hd; const double vgraphmin = ceil( vmin / vd ) * vd; const double vgraphmax = floor( vmax / vd ) * vd; - const int hnfrac = kigMax( (int) - floor( log10( hd ) ), 0 ); - const int vnfrac = kigMax( (int) - floor( log10( vd ) ), 0 ); + const int hnfrac = kigMax( ( int ) - floor( log10( hd ) ), 0 ); + const int vnfrac = kigMax( ( int ) - floor( log10( vd ) ), 0 ); /****** the grid lines ******/ if ( showgrid ) @@ -284,7 +309,7 @@ Rect( Coordinate( i, 0 ), hd, -2*vd ).normalized(), KLocale::global()->formatNumber( i, hnfrac ), Qt::AlignLeft | Qt::AlignTop - ); + ); }; // y axis... for ( double i = vgraphmin; i <= vgraphmax + vd/2; i += vd ) @@ -293,7 +318,7 @@ p.drawText ( Rect( Coordinate( 0, i ), 2*hd, vd ).normalized(), KLocale::global()->formatNumber( i, vnfrac ), Qt::AlignBottom | Qt::AlignLeft - ); + ); }; // arrows on the ends of the axes... p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); @@ -303,7 +328,7 @@ // the arrow on the right end of the X axis... a.reserve( 3 ); double u = p.pixelWidth(); - a.push_back( Coordinate( hmax - 6 * u, -3 * u) ); + a.push_back( Coordinate( hmax - 6 * u, -3 * u ) ); a.push_back( Coordinate( hmax, 0 ) ); a.push_back( Coordinate( hmax - 6 * u, 3 * u ) ); p.drawArea( a ); @@ -362,7 +387,7 @@ QString rs = KLocale::global()->formatNumber( r, l ); QString ts = KLocale::global()->formatNumber( theta, 0 ); - return QString::fromLatin1("( %1; %2 )").arg( rs ).arg( ts ); + return QString::fromLatin1( "( %1; %2 )" ).arg( rs ).arg( ts ); } QString PolarCoords::coordinateFormatNotice() const @@ -379,11 +404,11 @@ "where r and \xCE\xB8 are the polar coordinates." ); } -Coordinate PolarCoords::toScreen(const QString& s, bool& ok) const +Coordinate PolarCoords::toScreen( const QString& s, bool& ok ) const { QRegExp regexp( QString::fromUtf8( CoordinateValidator::rePolar ) ); ok = ( regexp.indexIn( s ) == 0 ); - if (ok) + if ( ok ) { QString rs = regexp.cap( 1 ); double r = KLocale::global()->readNumber( rs, &ok ); @@ -421,7 +446,7 @@ // the intervals: // we try to have one of them per 40 pixels or so.. const int ntick = static_cast<int>( - kigMax( hmax - hmin, vmax - vmin ) / p.pixelWidth() / 40 ) + 1; + kigMax( hmax - hmin, vmax - vmin ) / p.pixelWidth() / 40 ) + 1; const double hrange = nicenum( hmax - hmin, false ); const double vrange = nicenum( vmax - vmin, false ); @@ -429,13 +454,13 @@ const double hd = nicenum( hrange / ( ntick - 1 ), true ); const double vd = nicenum( vrange / ( ntick - 1 ), true ); - const double hgraphmin = floor( hmin / hd) * hd; + const double hgraphmin = floor( hmin / hd ) * hd; const double hgraphmax = ceil( hmax / hd ) * hd; const double vgraphmin = floor( vmin / vd ) * vd; const double vgraphmax = ceil( vmax / vd ) * vd; - const int hnfrac = kigMax( (int) - floor( log10( hd ) ), 0 ); - const int vnfrac = kigMax( (int) - floor( log10( vd ) ), 0 ); + const int hnfrac = kigMax( ( int ) - floor( log10( hd ) ), 0 ); + const int vnfrac = kigMax( ( int ) - floor( log10( vd ) ), 0 ); const int nfrac = kigMax( hnfrac, vnfrac ); /****** the grid lines ******/ @@ -487,7 +512,7 @@ p.drawText ( Rect( Coordinate( 0, i ), hd, vd ).normalized(), is, Qt::AlignBottom | Qt::AlignLeft - ); + ); }; // arrows on the ends of the axes... p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); @@ -497,7 +522,7 @@ // the arrow on the right end of the X axis... a.reserve( 3 ); double u = p.pixelWidth(); - a.push_back( Coordinate( hmax - 6 * u, -3 * u) ); + a.push_back( Coordinate( hmax - 6 * u, -3 * u ) ); a.push_back( Coordinate( hmax, 0 ) ); a.push_back( Coordinate( hmax - 6 * u, 3 * u ) ); // p.drawPolygon( a, true ); @@ -516,12 +541,12 @@ QValidator* EuclideanCoords::coordinateValidator() const { - return new CoordinateValidator( false ); + return new CoordinateValidator( CoordinateValidator::Euclidean ); } QValidator* PolarCoords::coordinateValidator() const { - return new CoordinateValidator( true ); + return new CoordinateValidator( CoordinateValidator::Polar ); } QStringList CoordinateSystemFactory::names() @@ -605,7 +630,7 @@ // the number of intervals we would like to have: // we try to have one of them per 40 pixels or so.. const int ntick = static_cast<int>( - kigMax( hmax - hmin, vmax - vmin ) / w.pixelWidth() / 40. ) + 1; + kigMax( hmax - hmin, vmax - vmin ) / w.pixelWidth() / 40. ) + 1; const double hrange = nicenum( hmax - hmin, false ); const double vrange = nicenum( vmax - vmin, false ); @@ -613,7 +638,7 @@ const double hd = nicenum( hrange / ( ntick - 1 ), true ); const double vd = nicenum( vrange / ( ntick - 1 ), true ); - const double hgraphmin = ceil( hmin / hd) * hd; + const double hgraphmin = ceil( hmin / hd ) * hd; const double vgraphmin = ceil( vmin / vd ) * vd; const double nx = qRound( ( c.x - hgraphmin ) / hd ) * hd + hgraphmin; @@ -640,7 +665,7 @@ // the intervals: // we try to have one of them per 40 pixels or so.. const int ntick = static_cast<int>( - kigMax( hmax - hmin, vmax - vmin ) / w.pixelWidth() / 40 ) + 1; + kigMax( hmax - hmin, vmax - vmin ) / w.pixelWidth() / 40 ) + 1; const double hrange = nicenum( hmax - hmin, false ); const double vrange = nicenum( vmax - vmin, false ); @@ -672,12 +697,12 @@ }; static const iterdata_t iterdata[] = - { - { +1, +1, &Rect::topRight, &Rect::bottomLeft, 0, M_PI/2 }, - { -1, +1, &Rect::topLeft, &Rect::bottomRight, M_PI, M_PI / 2 }, - { -1, -1, &Rect::bottomLeft, &Rect::topRight, M_PI, 3*M_PI/2 }, - { +1, -1, &Rect::bottomRight, &Rect::topLeft, 2*M_PI, 3*M_PI/2 } - }; + { + { +1, +1, &Rect::topRight, &Rect::bottomLeft, 0, M_PI/2 }, + { -1, +1, &Rect::topLeft, &Rect::bottomRight, M_PI, M_PI / 2 }, + { -1, -1, &Rect::bottomLeft, &Rect::topRight, M_PI, 3*M_PI/2 }, + { +1, -1, &Rect::bottomRight, &Rect::topLeft, 2*M_PI, 3*M_PI/2 } + }; for ( int i = 0; i < 4; ++i ) { int xd = iterdata[i].xd; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kig-15.04.1/misc/kiginputdialog.cc new/kig-15.04.2/misc/kiginputdialog.cc --- old/kig-15.04.1/misc/kiginputdialog.cc 2015-04-27 13:13:39.000000000 +0200 +++ new/kig-15.04.2/misc/kiginputdialog.cc 2015-05-27 05:50:05.000000000 +0200 @@ -76,18 +76,19 @@ : QDialog( parent ), d( new KigInputDialogPrivate() ) { - setWindowTitle( caption ); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); - QWidget *mainWidget = new QWidget(this); + QWidget *mainWidget = new QWidget( this ); QVBoxLayout *mainLayout = new QVBoxLayout; - setLayout(mainLayout); - mainLayout->addWidget(mainWidget); - d->okButton = buttonBox->button(QDialogButtonBox::Ok); - d->okButton->setDefault(true); - d->okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - mainLayout->addWidget(buttonBox); + QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel ); + QVBoxLayout* mainlay = new QVBoxLayout( mainWidget ); + + setWindowTitle( caption ); + setLayout( mainLayout ); + mainLayout->addWidget( mainWidget ); + d->okButton = buttonBox->button( QDialogButtonBox::Ok ); + d->okButton->setDefault( true ); + d->okButton->setShortcut( Qt::CTRL | Qt::Key_Return ); + connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); + connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); d->m_coord1 = c1 ? Coordinate( *c1 ) : Coordinate::invalidCoord(); d->m_coord2 = c2 ? Coordinate( *c2 ) : Coordinate::invalidCoord(); @@ -96,18 +97,15 @@ bool ok = false; - QWidget* frame = new QWidget(); -//PORTING: Verify that widget was added to mainLayout setMainWidget( frame ); - QVBoxLayout* mainlay = new QVBoxLayout( frame ); mainlay->setMargin( 0 ); mainlay->activate(); - d->m_label = new QLabel( frame ); + d->m_label = new QLabel( mainWidget ); d->m_label->setTextFormat( Qt::RichText ); d->m_label->setText( label ); mainlay->addWidget( d->m_label ); - d->m_lineEditFirst = new KLineEdit( frame ); + d->m_lineEditFirst = new KLineEdit( mainWidget ); // d->m_lineEditFirst->setValidator( d->m_vtor ); if ( d->m_coord1.valid() ) { @@ -121,7 +119,7 @@ if ( d->m_coord2.valid() ) { - d->m_lineEditSecond = new KLineEdit( frame ); + d->m_lineEditSecond = new KLineEdit( mainWidget ); // d->m_lineEditSecond->setValidator( d->m_vtor ); d->m_lineEditSecond->setText( d->m_doc->coordinateSystem().fromScreen( d->m_coord2, *d->m_doc ) ); mainlay->addWidget( d->m_lineEditSecond ); @@ -131,48 +129,52 @@ } resize( minimumSizeHint() ); - d->m_lineEditFirst->setFocus(); - d->okButton->setEnabled( ok ); + + mainLayout->addWidget( mainWidget ); + mainLayout->addWidget( buttonBox ); } KigInputDialog::KigInputDialog( QWidget* parent, const Goniometry& g ) : QDialog( parent ), d( new KigInputDialogPrivate() ) { + QWidget *mainWidget = new QWidget( this ); + QVBoxLayout *mainLayout = new QVBoxLayout; + QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel ); + QPushButton *okButton = buttonBox->button( QDialogButtonBox::Ok ); + QVBoxLayout* mainlay = new QVBoxLayout( mainWidget ); + QHBoxLayout* horlay = new QHBoxLayout( mainWidget ); + setWindowTitle( i18n( "Set Angle Size" ) ); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); - QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); - okButton->setDefault(true); - okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + setLayout( mainLayout ); + okButton->setDefault( true ); + okButton->setShortcut( Qt::CTRL | Qt::Key_Return ); + d->okButton = okButton; + connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); + connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); d->m_gonio = g; d->m_gonioIsNum = true; - QWidget* frame = new QWidget(); -//PORTING: Verify that widget was added to mainLayout setMainWidget( frame ); - QVBoxLayout* mainlay = new QVBoxLayout( frame ); mainlay->setMargin( 0 ); mainlay->activate(); - d->m_label = new QLabel( frame ); + d->m_label = new QLabel( mainWidget ); d->m_label->setText( i18n( "Insert the new size of this angle:" ) ); mainlay->addWidget( d->m_label ); - QHBoxLayout* horlay = new QHBoxLayout( (QWidget*)0 ); - horlay->setMargin( 0 ); - horlay->activate(); +// horlay->setMargin( 0 ); +// horlay->activate(); - d->m_lineEditFirst = new KLineEdit( frame ); + d->m_lineEditFirst = new KLineEdit( mainWidget ); d->m_lineEditFirst->setText( QString::number( d->m_gonio.value() ) ); d->m_lineEditFirst->setWhatsThis( i18n( "Use this edit field to modify the size of this angle." ) ); horlay->addWidget( d->m_lineEditFirst ); - d->m_comboBox = new KComboBox( frame ); + d->m_comboBox = new KComboBox( mainWidget ); d->m_comboBox->addItems( Goniometry::systemList() ); d->m_comboBox->setCurrentIndex( d->m_gonio.system() ); d->m_comboBox->setWhatsThis( @@ -182,9 +184,6 @@ "the left will be converted to the new selected unit." ) ); horlay->addWidget( d->m_comboBox ); - mainlay->addLayout( horlay ); - mainlay->addWidget( buttonBox ); - connect( d->m_lineEditFirst, SIGNAL(textChanged(const QString&)), this, SLOT(slotGonioTextChanged(const QString&)) ); connect( d->m_comboBox, SIGNAL(activated(int)), @@ -193,6 +192,10 @@ resize( 350, 100 ); d->m_lineEditFirst->setFocus(); + + mainlay->addLayout( horlay ); + mainLayout->addWidget( mainWidget ); + mainLayout->addWidget( buttonBox ); } void KigInputDialog::keyPressEvent( QKeyEvent* e )
