~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to okteta/gui/abstractbytearrayview_p.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 11:49:54 UTC
  • mfrom: (0.4.21)
  • Revision ID: package-import@ubuntu.com-20120606114954-rdls73fzlpzxglbx
Tags: 4:4.8.80-0ubuntu1
* New uptream beta release
* Update dont_export_private_classes.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "widgetcolumnstylist.h"
33
33
#include "kcursor.h"
34
34
#include "bordercolumnrenderer.h"
 
35
#include "oktetagui.h"
35
36
// Okteta core
36
37
#include <valuecodec.h>
37
38
#include <bookmarkable.h>
54
55
 
55
56
static const Address DefaultStartOffset = 0;//5;
56
57
static const Address DefaultFirstLineOffset = 0;
57
 
static const int DefaultNoOfBytesPerLine =  16;
58
58
 
59
59
// zooming is done in steps of font size points
60
60
static const int DefaultZoomStep = 1;
64
64
static const AbstractByteArrayView::ValueCoding DefaultValueCoding =  AbstractByteArrayView::HexadecimalCoding;
65
65
static const AbstractByteArrayView::CharCoding DefaultCharCoding = AbstractByteArrayView::LocalEncoding;
66
66
 
67
 
static const AbstractByteArrayView::LayoutStyle DefaultResizeStyle = AbstractByteArrayView::FullSizeLayoutStyle;
 
67
static const AbstractByteArrayView::LayoutStyle DefaultResizeStyle = AbstractByteArrayView::FixedLayoutStyle;
68
68
 
69
69
static const char OctetStreamFormatName[] = "application/octet-stream";
70
70
 
232
232
 
233
233
void AbstractByteArrayViewPrivate::toggleOffsetColumn( bool showOffsetColumn )
234
234
{
 
235
    Q_Q( AbstractByteArrayView );
 
236
 
235
237
    const bool isVisible = mOffsetColumn->isVisible();
236
238
    // no change?
237
239
    if( isVisible == showOffsetColumn )
240
242
    mOffsetColumn->setVisible( showOffsetColumn );
241
243
 
242
244
    updateViewByWidth();
 
245
 
 
246
    emit q->offsetColumnVisibleChanged( showOffsetColumn );
243
247
}
244
248
 
245
249
 
384
388
 
385
389
void AbstractByteArrayViewPrivate::setLayoutStyle( AbstractByteArrayView::LayoutStyle layoutStyle )
386
390
{
 
391
    Q_Q( AbstractByteArrayView );
 
392
 
387
393
    const bool isChanged = ( mResizeStyle != layoutStyle );
388
394
 
389
395
    if( !isChanged )
391
397
 
392
398
    mResizeStyle = layoutStyle;
393
399
    updateViewByWidth();
 
400
 
 
401
    emit q->layoutStyleChanged( mResizeStyle );
394
402
}
395
403
 
396
404
void AbstractByteArrayViewPrivate::setNoOfBytesPerLine( int noOfBytesPerLine )
397
405
{
 
406
    Q_Q( AbstractByteArrayView );
 
407
 
398
408
    // if the number is explicitly set we expect a wish for no automatic resize
399
409
    setLayoutStyle( AbstractByteArrayView::FixedLayoutStyle );
400
410
 
402
412
        return;
403
413
 
404
414
    updateViewByWidth();
 
415
 
 
416
    emit q->noOfBytesPerLineChanged( mTableLayout->noOfBytesPerLine() );
405
417
}
406
418
 
407
419