mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
generic: replace deprecated qVariantValue<T> with qvariant_cast<T>
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7dc45583ee
commit
3e7ed94fd6
8 changed files with 13 additions and 13 deletions
|
@ -63,7 +63,7 @@ void DropPixmapItem::dropEvent(QGraphicsSceneDragDropEvent* event)
|
|||
if( event->mimeData()->hasImage() )
|
||||
{
|
||||
debug() << "mimeData has image";
|
||||
emit imageDropped( qVariantValue< QPixmap >( event->mimeData()->imageData() ) );
|
||||
emit imageDropped( qvariant_cast< QPixmap >( event->mimeData()->imageData() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ bool KDevSvnPlugin::isVersionControlled(const KUrl& localLocation)
|
|||
QVariant result = job->fetchResults();
|
||||
|
||||
if (result.isValid()) {
|
||||
SvnInfoHolder h = qVariantValue<SvnInfoHolder>(result);
|
||||
SvnInfoHolder h = qvariant_cast<SvnInfoHolder>(result);
|
||||
return !h.name.isEmpty();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -136,7 +136,7 @@ public:
|
|||
if( currentTargetAction->currentAction() )
|
||||
{
|
||||
KConfigGroup grp = Core::self()->activeSession()->config()->group( RunController::LaunchConfigurationsGroup );
|
||||
LaunchConfiguration* l = static_cast<LaunchConfiguration*>( qVariantValue<void*>( currentTargetAction->currentAction()->data() ) );
|
||||
LaunchConfiguration* l = static_cast<LaunchConfiguration*>( qvariant_cast<void*>( currentTargetAction->currentAction()->data() ) );
|
||||
grp.writeEntry( CurrentLaunchConfigProjectEntry, l->project() ? l->project()->name() : "" );
|
||||
grp.writeEntry( CurrentLaunchConfigNameEntry, l->configGroupName() );
|
||||
grp.sync();
|
||||
|
@ -223,7 +223,7 @@ public:
|
|||
LaunchConfiguration* l = 0;
|
||||
if( currentTargetAction->currentAction() )
|
||||
{
|
||||
l = static_cast<LaunchConfiguration*>( qVariantValue<void*>( currentTargetAction->currentAction()->data() ) );
|
||||
l = static_cast<LaunchConfiguration*>( qvariant_cast<void*>( currentTargetAction->currentAction()->data() ) );
|
||||
} else if( !launchConfigurations.isEmpty() )
|
||||
{
|
||||
l = launchConfigurations.at( 0 );
|
||||
|
@ -324,7 +324,7 @@ void KDevelop::RunController::launchChanged( LaunchConfiguration* l )
|
|||
{
|
||||
foreach( QAction* a, d->currentTargetAction->actions() )
|
||||
{
|
||||
if( static_cast<LaunchConfiguration*>( qVariantValue<void*>( a->data() ) ) == l )
|
||||
if( static_cast<LaunchConfiguration*>( qvariant_cast<void*>( a->data() ) ) == l )
|
||||
{
|
||||
a->setText( d->launchActionText( l ) );
|
||||
break;
|
||||
|
@ -808,7 +808,7 @@ void KDevelop::RunController::removeLaunchConfiguration(KDevelop::LaunchConfigur
|
|||
|
||||
foreach( QAction* a, d->currentTargetAction->actions() )
|
||||
{
|
||||
if( static_cast<LaunchConfiguration*>( qVariantValue<void*>( a->data() ) ) == l )
|
||||
if( static_cast<LaunchConfiguration*>( qvariant_cast<void*>( a->data() ) ) == l )
|
||||
{
|
||||
bool wasSelected = a->isChecked();
|
||||
d->currentTargetAction->removeAction( a );
|
||||
|
@ -839,7 +839,7 @@ void RunController::setDefaultLaunch(ILaunchConfiguration* l)
|
|||
{
|
||||
foreach( QAction* a, d->currentTargetAction->actions() )
|
||||
{
|
||||
if( static_cast<ILaunchConfiguration*>( qVariantValue<void*>( a->data() ) ) == l )
|
||||
if( static_cast<ILaunchConfiguration*>( qvariant_cast<void*>( a->data() ) ) == l )
|
||||
{
|
||||
a->setChecked(true);
|
||||
break;
|
||||
|
|
|
@ -167,7 +167,7 @@ void VcsEventModel::jobReceivedResults(KJob* job)
|
|||
{
|
||||
if( qVariantCanConvert<KDevelop::VcsEvent>( v ) )
|
||||
{
|
||||
newevents << qVariantValue<KDevelop::VcsEvent>( v );
|
||||
newevents << qvariant_cast<KDevelop::VcsEvent>( v );
|
||||
}
|
||||
}
|
||||
d->m_rev = newevents.last().revision();
|
||||
|
|
|
@ -131,7 +131,7 @@ void fetchStatus(int line, QList<VcsStatusInfo> & statuslist, IBasicVersionContr
|
|||
statuslist.clear();
|
||||
foreach(const QVariant & v, untypedList) {
|
||||
QVERIFY(v.canConvert<VcsStatusInfo>());
|
||||
statuslist.push_back(qVariantValue<VcsStatusInfo>(v));
|
||||
statuslist.push_back(qvariant_cast<VcsStatusInfo>(v));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ VCSDiffPatchSource::VCSDiffPatchSource(VCSDiffUpdater* updater)
|
|||
|
||||
foreach( const QVariant &var, varlist.toList() )
|
||||
{
|
||||
VcsStatusInfo info = qVariantValue<KDevelop::VcsStatusInfo>( var );
|
||||
VcsStatusInfo info = qvariant_cast<KDevelop::VcsStatusInfo>( var );
|
||||
|
||||
m_infos += info;
|
||||
if(info.state()!=VcsStatusInfo::ItemUpToDate)
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
{
|
||||
if( job != m_job )
|
||||
return;
|
||||
KDevelop::VcsDiff diff = qVariantValue<KDevelop::VcsDiff>( m_job->fetchResults() );
|
||||
KDevelop::VcsDiff diff = qvariant_cast<KDevelop::VcsDiff>( m_job->fetchResults() );
|
||||
|
||||
// Try using the patch-review plugin if possible
|
||||
VCSDiffPatchSource* patch = new VCSDiffPatchSource(diff);
|
||||
|
|
|
@ -666,7 +666,7 @@ void TranslationUnitTextEdit::insertFromMimeData(const QMimeData* source)
|
|||
QByteArray data=source->data("application/x-lokalize-xliff+xml");
|
||||
QDataStream in(&data,QIODevice::ReadOnly);
|
||||
in>>v;
|
||||
//qWarning()<<"ins"<<qVariantValue<CatalogString>(v).string<<qVariantValue<CatalogString>(v).ranges.size();
|
||||
//qWarning()<<"ins"<<qvariant_cast<CatalogString>(v).string<<qvariant_cast<CatalogString>(v).ranges.size();
|
||||
|
||||
int start=0;
|
||||
m_catalog->beginMacro(i18nc("@item Undo action item","Insert text with markup"));
|
||||
|
@ -688,7 +688,7 @@ void TranslationUnitTextEdit::insertFromMimeData(const QMimeData* source)
|
|||
start=textCursor().position();
|
||||
}
|
||||
|
||||
insertCatalogString(qVariantValue<CatalogString>(v), start);
|
||||
insertCatalogString(qvariant_cast<CatalogString>(v), start);
|
||||
m_catalog->endMacro();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue