~ubuntu-branches/ubuntu/quantal/kate/quantal-proposed

« back to all changes in this revision

Viewing changes to part/search/katesearchbar.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 13:28:06 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111214132806-aa2uf6ri5w2p8ak3
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
        m_powerMode(0)
147
147
{
148
148
 
149
 
    connect(view, SIGNAL(cursorPositionChanged(KTextEditor::View *, KTextEditor::Cursor const &)),
 
149
    connect(view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)),
150
150
            this, SLOT(updateIncInitCursor()));
151
151
 
152
152
    // init match attribute
196
196
    }
197
197
 
198
198
    updateSelectionOnly();
199
 
    connect(view, SIGNAL(selectionChanged(KTextEditor::View *)),
 
199
    connect(view, SIGNAL(selectionChanged(KTextEditor::View*)),
200
200
            this, SLOT(updateSelectionOnly()));
201
201
}
202
202
 
211
211
    delete m_powerUi;
212
212
}
213
213
 
214
 
 
 
214
void KateSearchBar::closed()
 
215
{
 
216
    // remove search from the view bar, because it vertically bloats up the
 
217
    // stacked layout in KateViewBar.
 
218
    if (viewBar()) {
 
219
        viewBar()->removeBarWidget(this);
 
220
    }
 
221
}
215
222
 
216
223
 
217
224
void KateSearchBar::setReplacePattern(const QString &replacementPattern) {
355
362
 
356
363
 
357
364
void KateSearchBar::selectRange2(const KTextEditor::Range & range) {
358
 
    disconnect(m_view, SIGNAL(selectionChanged(KTextEditor::View *)), this, SLOT(updateSelectionOnly()));
 
365
    disconnect(m_view, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(updateSelectionOnly()));
359
366
    selectRange(m_view, range);
360
 
    connect(m_view, SIGNAL(selectionChanged(KTextEditor::View *)), this, SLOT(updateSelectionOnly()));
 
367
    connect(m_view, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(updateSelectionOnly()));
361
368
}
362
369
 
363
370
 
395
402
                                                     Range::invalid();
396
403
 
397
404
    // don't update m_incInitCursor when we move the cursor
398
 
    disconnect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor const&)),
 
405
    disconnect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)),
399
406
               this, SLOT(updateIncInitCursor()));
400
407
    selectRange2(selectionRange);
401
 
    connect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor const&)),
 
408
    connect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)),
402
409
            this, SLOT(updateIncInitCursor()));
403
410
 
404
411
    indicateMatch(matchResult);
1322
1329
    if (create) {
1323
1330
        // Slots
1324
1331
        connect(m_powerUi->mutate, SIGNAL(clicked()), this, SLOT(enterIncrementalMode()));
1325
 
        connect(patternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(onPowerPatternChanged(const QString &)));
 
1332
        connect(patternLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onPowerPatternChanged(QString)));
1326
1333
        connect(m_powerUi->findNext, SIGNAL(clicked()), this, SLOT(findNext()));
1327
1334
        connect(m_powerUi->findPrev, SIGNAL(clicked()), this, SLOT(findPrevious()));
1328
1335
        connect(m_powerUi->replaceNext, SIGNAL(clicked()), this, SLOT(replaceNext()));
1337
1344
 
1338
1345
        // Hook into line edit context menus
1339
1346
        m_powerUi->pattern->setContextMenuPolicy(Qt::CustomContextMenu);
1340
 
        connect(m_powerUi->pattern, SIGNAL(customContextMenuRequested(const QPoint&)), this,
1341
 
                SLOT(onPowerPatternContextMenuRequest(const QPoint&)));
 
1347
        connect(m_powerUi->pattern, SIGNAL(customContextMenuRequested(QPoint)), this,
 
1348
                SLOT(onPowerPatternContextMenuRequest(QPoint)));
1342
1349
        m_powerUi->replacement->setContextMenuPolicy(Qt::CustomContextMenu);
1343
 
        connect(m_powerUi->replacement, SIGNAL(customContextMenuRequested(const QPoint&)), this,
1344
 
                SLOT(onPowerReplacmentContextMenuRequest(const QPoint&)));
 
1350
        connect(m_powerUi->replacement, SIGNAL(customContextMenuRequested(QPoint)), this,
 
1351
                SLOT(onPowerReplacmentContextMenuRequest(QPoint)));
1345
1352
    }
1346
1353
 
1347
1354
    // Focus
1446
1453
 
1447
1454
    // Set initial search pattern
1448
1455
    if (!create)
1449
 
        disconnect(m_incUi->pattern, SIGNAL(textChanged(const QString&)), this, SLOT(onIncPatternChanged(const QString&)));
 
1456
        disconnect(m_incUi->pattern, SIGNAL(textChanged(QString)), this, SLOT(onIncPatternChanged(QString)));
1450
1457
    m_incUi->pattern->setEditText(initialPattern);
1451
 
    connect(m_incUi->pattern, SIGNAL(textChanged(const QString&)), this, SLOT(onIncPatternChanged(const QString&)));
 
1458
    connect(m_incUi->pattern, SIGNAL(textChanged(QString)), this, SLOT(onIncPatternChanged(QString)));
1452
1459
    m_incUi->pattern->lineEdit()->selectAll();
1453
1460
 
1454
1461
    // Propagate settings (slots are still inactive on purpose)