Changeset View
Changeset View
Standalone View
Standalone View
kcms/solid_actions/SolidActions.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 117 | { | |||
---|---|---|---|---|---|
131 | 131 | | |||
132 | // Fill in an initial template | 132 | // Fill in an initial template | ||
133 | KDesktopFile * newDesktop = templateDesktop.copyTo(filePath); | 133 | KDesktopFile * newDesktop = templateDesktop.copyTo(filePath); | ||
134 | newDesktop->actionGroup(QStringLiteral("open")).writeEntry("Name", enteredName); // ditto | 134 | newDesktop->actionGroup(QStringLiteral("open")).writeEntry("Name", enteredName); // ditto | ||
135 | delete newDesktop; // Force file to be written | 135 | delete newDesktop; // Force file to be written | ||
136 | 136 | | |||
137 | // Prepare to open the editDialog | 137 | // Prepare to open the editDialog | ||
138 | fillActionsList(); | 138 | fillActionsList(); | ||
139 | QList<ActionItem*> actionList = actionModel->actionList(); | 139 | const QList<ActionItem*> actionList = actionModel->actionList(); | ||
140 | QModelIndex newAction; | 140 | QModelIndex newAction; | ||
141 | foreach( ActionItem * newItem, actionList ) { // Lets find our new action | 141 | for (ActionItem *newItem : actionList) { // Lets find our new action | ||
142 | if( newItem->desktopMasterPath == filePath ) { | 142 | if( newItem->desktopMasterPath == filePath ) { | ||
143 | const int position = actionList.indexOf( newItem ); | 143 | const int position = actionList.indexOf( newItem ); | ||
144 | newAction = actionModel->index( position, 0 ); // Grab it | 144 | newAction = actionModel->index( position, 0 ); // Grab it | ||
145 | break; | 145 | break; | ||
146 | } | 146 | } | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | mainUi.TvActions->setCurrentIndex( newAction ); // Set it as currently active | 149 | mainUi.TvActions->setCurrentIndex( newAction ); // Set it as currently active | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |