Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/agent-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
run: |
mkdir $KLOGG_BUILD_ROOT
cd $KLOGG_BUILD_ROOT
cmake $KLOGG_CMAKE_OPTS -DCPM_SOURCE_CACHE=$KLOGG_WORKSPACE/cpm_cache -DKLOGG_OVERRIDE_MALLOC=OFF $KLOGG_WORKSPACE
cmake $KLOGG_CMAKE_OPTS -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCPM_SOURCE_CACHE=$KLOGG_WORKSPACE/cpm_cache -DKLOGG_OVERRIDE_MALLOC=OFF $KLOGG_WORKSPACE

- name: build
shell: sh
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/agent-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:

- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ../Qt
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.qt_version }}-QtCache
Expand All @@ -30,7 +30,7 @@ runs:
echo "BOOST_URL=https://sourceforge.net/projects/boost/files/boost/1.86.0/boost_1_86_0.tar.bz2/download" >> $GITHUB_ENV

- name: Restore Boost cache
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-boost
with:
path: ${{env.BOOST_ROOT}}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Save version
run: echo $KLOGG_VERSION > klogg_version.txt

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: klogg_version
path: 'klogg_version.txt'
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- uses: ./.github/actions/docker-package

# Final upload of all packages
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.config.artifacts_id }}
path: '${{ env.KLOGG_BUILD_ROOT }}/packages/*'
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
notarization-team: ${{ secrets.NOTARIZATION_TEAM }}
notarization-password: ${{ secrets.NOTARIZATION_PASSWORD }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.config.artifacts_id }}
path: '${{ env.KLOGG_BUILD_ROOT }}/packages/*'
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:

- name: Cache openssl
id: cache-openssl
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\openssl-1.1
key: OpensslCache-1-1-1w
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
s3-bucket: ${{ secrets.WIN_CS_BUCKET }}

# Final upload of all packages
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.config.artifacts_id }}
path: '${{ env.KLOGG_BUILD_ROOT }}/packages/*'
Expand Down
11 changes: 2 additions & 9 deletions packaging/windows/prepare_release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@ xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg.pdb %KLOGG_WORKSPACE%\re
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_crashpad_handler.exe %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_minidump_dump.exe %KLOGG_WORKSPACE%\release\ /y

xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.41_cxx17_64_md_relwithdebinfo\tbb12.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.41_cxx17_64_md_relwithdebinfo\tbb12.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.41_cxx17_32_md_relwithdebinfo\tbb12.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.41_cxx17_32_md_relwithdebinfo\tbb12.pdb %KLOGG_WORKSPACE%\release\ /y

xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.42_cxx17_64_md_relwithdebinfo\tbb12.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.42_cxx17_64_md_relwithdebinfo\tbb12.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.42_cxx17_32_md_relwithdebinfo\tbb12.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\msvc_19.42_cxx17_32_md_relwithdebinfo\tbb12.pdb %KLOGG_WORKSPACE%\release\ /y
for /r "%KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%" %%F in (tbb12.dll) do xcopy "%%F" %KLOGG_WORKSPACE%\release\ /y
for /r "%KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%" %%F in (tbb12.pdb) do xcopy "%%F" %KLOGG_WORKSPACE%\release\ /y

xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\generated\documentation.html %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\COPYING %KLOGG_WORKSPACE%\release\ /y
Expand Down
4 changes: 2 additions & 2 deletions src/ui/include/crawlerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class CrawlerWidget : public QSplitter,
void updatePredefinedFiltersWidget();

// Reload predefined filters after changing settings
void reloadPredefinedFilters() const;
void reloadPredefinedFilters();

QString escapeSearchPattern( const QString& searchPattern, bool isRegex = false ) const;
QString& combinePatterns( QString& currentPattern, const QString& newPattern ) const;
Expand All @@ -359,6 +359,7 @@ class CrawlerWidget : public QSplitter,
SavedSearches* savedSearches_ = nullptr;

std::shared_ptr<LogData> logData_;
std::unique_ptr<LogMainViewData> logMainViewData_;
std::shared_ptr<LogFilteredData> logFilteredData_;

// Matches overview
Expand Down Expand Up @@ -394,7 +395,6 @@ class CrawlerWidget : public QSplitter,
QToolButton* inverseButton_;
QToolButton* booleanButton_;
QToolButton* searchRefreshButton_;

std::map<QString, QShortcut*> shortcuts_;

// Default palette to be remembered
Expand Down
59 changes: 58 additions & 1 deletion src/ui/include/logmainview.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,72 @@
#ifndef LOGMAINVIEW_H
#define LOGMAINVIEW_H

#include <memory>

#include "abstractlogview.h"
#include "logdata.h"
#include "logfiltereddata.h"

class LogMainViewData : public AbstractLogData
{
Q_OBJECT

public:
explicit LogMainViewData( const LogData* sourceLogData );

void setTopFilter( const RegularExpressionPattern& pattern );
void prepareFullRefresh();
void refreshSearch();
void interruptSearch();

LineNumber getSourceLineNumber( LineNumber index ) const;
LineNumber getLineIndexNumber( LineNumber sourceLine ) const;
LinesCount getNbTotalLines() const;

Q_SIGNALS:
void searchProgressed( LinesCount nbMatches, int progress, LineNumber initialLine );

protected:
QString doGetLineString( LineNumber line ) const override;
QString doGetExpandedLineString( LineNumber line ) const override;
klogg::vector<QString> doGetLines( LineNumber firstLine, LinesCount number ) const override;
klogg::vector<QString> doGetExpandedLines( LineNumber firstLine,
LinesCount number ) const override;
LineNumber doGetLineNumber( LineNumber index ) const override;
LinesCount doGetNbLine() const override;
LineLength doGetMaxLength() const override;
LineLength doGetLineLength( LineNumber line ) const override;
void doSetDisplayEncoding( const char* encoding ) override;
QTextCodec* doGetDisplayEncoding() const override;
void doAttachReader() const override;
void doDetachReader() const override;

private:
const AbstractLogData* activeData() const;

const LogData* sourceLogData_;
std::unique_ptr<LogFilteredData> filteredData_;
RegularExpressionPattern filterPattern_;
bool filterEnabled_ = false;
bool fullRefreshRequired_ = false;
};

// Class implementing the main (top) view widget.
class LogMainView : public AbstractLogView
{
Q_OBJECT
public:
LogMainView( const LogData* newLogData,
LogMainView( LogMainViewData* newLogData,
const QuickFindPattern* const quickFindPattern,
Overview* overview,
OverviewWidget* overview_widget,
QWidget* parent = nullptr );

LineNumber getTopSourceLine() const;
void trySelectSourceLine( LineNumber sourceLine );
void selectSourcePortionAndDisplayLine( LineNumber sourceLine, LinesCount nLines,
LineColumn startCol, LineLength nSymbols );

// Configure the view to use the passed filtered list
// (used for couloured bullets)
// Should be NULL or the empty LFD if no filtering is used
Expand All @@ -63,10 +115,15 @@ class LogMainView : public AbstractLogView
// Implements the virtual function
LogData::LineType lineType( LineNumber lineNumber ) const override;

LineNumber displayLineNumber( LineNumber lineNumber ) const override;
LineNumber lineIndex( LineNumber lineNumber ) const override;
LineNumber maxDisplayLineNumber() const override;

void doRegisterShortcuts() override;

private:
LogFilteredData* filteredData_;
LogMainViewData* logMainViewData_;
};

#endif
5 changes: 3 additions & 2 deletions src/ui/include/predefinedfilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct PredefinedFilter {
QString name;
QString pattern;
bool useRegex;
bool filterTop = false;
};

// Represents collection of filters read from settings file.
Expand All @@ -70,11 +71,11 @@ class PredefinedFiltersCollection final : public Persistable<PredefinedFiltersCo
void saveToStorage( const Collection& filters );

private:
static constexpr int PredefinedFiltersCollection_VERSION = 2;
static constexpr int PredefinedFiltersCollection_VERSION = 3;

Collection filters_;
};

Q_DECLARE_METATYPE(PredefinedFilter)

#endif
#endif
15 changes: 12 additions & 3 deletions src/ui/src/abstractlogview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void AbstractLogView::doRegisterShortcuts()

registerShortcut( ShortcutAction::LogViewJumpToLineNumber, [ this ]() {
const auto newLine = qMax( 0ull, digitsBuffer_.content() - 1ull );
trySelectLine( LineNumber( newLine ) );
trySelectLine( lineIndex( LineNumber( newLine ) ) );
} );

registerShortcut( ShortcutAction::LogViewExitView, [ this ]() { Q_EMIT exitView(); } );
Expand Down Expand Up @@ -1188,7 +1188,7 @@ void AbstractLogView::setOverview( Overview* overview, OverviewWidget* overviewW

if ( overviewWidget_ ) {
connect( overviewWidget_, &OverviewWidget::lineClicked, this,
&AbstractLogView::jumpToLine );
[ this ]( LineNumber line ) { jumpToLine( lineIndex( line ) ); } );
}
refreshOverview();
}
Expand Down Expand Up @@ -1609,7 +1609,16 @@ void AbstractLogView::updateData()
if ( overview_ != nullptr ) {
// Calculate the index of the last line shown
const LineNumber lastLine = qMin( lastLineNumber, firstLine_ + getNbVisibleLines() );
overview_->updateCurrentPosition( firstLine_, lastLine );
if ( lastLineNumber > 0_lnum ) {
const auto firstSourceLine = displayLineNumber( firstLine_ ) - 1_lcount;
const auto lastSourceLine = lastLine > firstLine_
? displayLineNumber( lastLine - 1_lcount )
: firstSourceLine;
overview_->updateCurrentPosition( firstSourceLine, lastSourceLine );
}
else {
overview_->updateCurrentPosition( 0_lnum, 0_lnum );
}
}

forceRefresh();
Expand Down
Loading