Code clean-up

Mostly, removal of old code that had been commented out instead of
removed
preferencesAboutTextFull
Craig Watson 9 years ago
parent 631b070e82
commit da5378a68c
  1. 7
      src/board/UBBoardController.cpp
  2. 4
      src/board/UBFeaturesController.cpp
  3. 2
      src/core/UB.h
  4. 6
      src/core/UBApplication.cpp
  5. 5
      src/core/UBApplicationController.h
  6. 8
      src/domain/UBGraphicsMediaItem.cpp
  7. 11
      src/frameworks/UBPlatformUtils_mac.mm
  8. 1
      src/gui/UBFloatingPalette.cpp
  9. 1
      src/gui/UBMagnifer.cpp
  10. 4
      src/tools/UBGraphicsTriangle.cpp
  11. 1
      src/tools/UBGraphicsTriangle.h
  12. 7
      src/tools/UBToolsManager.cpp

@ -27,10 +27,7 @@
#include "UBBoardController.h"
//#include <QtGui>
#include <QtWidgets>
//#include <QtWebKit>
#include <QtWebKitWidgets>
#include "frameworks/UBFileSystemUtils.h"
@ -992,8 +989,6 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
if (isBackground)
oldBackgroundObject = mActiveScene->backgroundObject();
//if(sUrl.startsWith("uniboardTool://"))
//if(sUrl.startsWith("openboardTool://",Qt::CaseInsensitive))
if(sUrl.startsWith("openboardtool://"))
{
@ -1094,7 +1089,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
mActiveScene->deselectAllItems();
//if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("uniboardTool://"))
if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("openboardtool://"))
showMessage(tr("Download finished"));
@ -1375,7 +1369,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
}
}
//else if (UBMimeType::UniboardTool == itemMimeType)
else if (UBMimeType::OpenboardTool == itemMimeType)
{
qDebug() << "accepting mime type" << mimeType << "OpenBoard Tool";

@ -347,7 +347,6 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
featuresModel = new UBFeaturesModel(featuresList, this);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
featuresProxyModel = new UBFeaturesProxyModel(this);
featuresProxyModel->setFilterFixedString(rootPath);
@ -607,7 +606,6 @@ void UBFeaturesController::addToFavorite( const QUrl &path )
void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManualy)
{
// QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) != favoriteSet->end() )
{
favoriteSet->erase( favoriteSet->find( path ) );
@ -622,7 +620,6 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu
QString UBFeaturesController::fileNameFromUrl( const QUrl &url )
{
QString fileName = url.toString();
//if ( fileName.contains( "uniboardTool://"))
if ( fileName.contains( "OpenboardTool://"))
return fileName;
return url.toLocalFile();
@ -633,7 +630,6 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
{
QFileInfo fileInfo(path);
//if ( path.contains("uniboardTool://"))
if ( path.contains("OpenboardTool://"))
return FEATURE_INTERNAL;

@ -28,7 +28,6 @@
#ifndef UB_H_
#define UB_H_
//#include <QtGui>
#include <QtWidgets>
@ -46,7 +45,6 @@ struct UBMimeType
Audio,
Flash,
PDF,
//UniboardTool,
OpenboardTool,
Group,
UNKNOWN

@ -183,20 +183,18 @@ UBApplication::~UBApplication()
QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
{
QStringList availableTranslations = UBPlatformUtils::availableTranslations();
//QStringList availableTranslations ;availableTranslations<< "OpenBoard_fr";
if(availableTranslations.contains(language,Qt::CaseInsensitive))
return language;
else{
if(language.length() > 2){
QString shortLanguageCode = language.left(2);
//if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive))
foreach (const QString &str, availableTranslations) {
if (str.contains(shortLanguageCode))
return shortLanguageCode;
}
//if(availableTranslations.contains(shortLanguageCode))
//return shortLanguageCode;
}
}
return QString("");

@ -28,13 +28,10 @@
#ifndef UBAPPLICATIONCONTROLLER_H_
#define UBAPPLICATIONCONTROLLER_H_
//#include <QtGui>
#include <QtWidgets>
#include <QtNetwork>
//#include <QFtp>
//#include <QHttpResponseHeader>
#include <QNetworkAccessManager>
@ -55,7 +52,6 @@ class UBSoftwareUpdate;
class QNetworkAccessManager;
class QNetworkReply;
class QHttpPart;
//class QHttp;
class UBRightPalette;
class UBOpenSankoreImporter;
class QScriptValue;
@ -161,7 +157,6 @@ class UBApplicationController : public QObject
private slots:
void updateRequestFinished(int id, bool error);
//void updateHeaderReceived(QHttpResponseHeader header);
void updateHeaderReceived(QNetworkRequest header );
protected:

@ -114,16 +114,16 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
Delegate()->createControls();
if (mediaType_Audio == mMediaType)
Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally);
else
else {
Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
// Resize the widget as soon as the video's native size is known (it isn't at this stage)
connect(mVideoItem, SIGNAL(nativeSizeChanged(QSizeF)), this, SLOT(resize(QSizeF)));
}
setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
connect(Delegate(), SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool)));
connect(mMediaObject, SIGNAL(videoAvailableChanged(bool)), this, SLOT(hasMediaChanged(bool)));
// Resize the widget as soon as the video's native size is known (it isn't at this stage)
connect(mVideoItem, SIGNAL(nativeSizeChanged(QSizeF)), this, SLOT(resize(QSizeF)));
}

@ -57,15 +57,6 @@ void UBPlatformUtils::init()
{
initializeKeyboardLayouts();
// qwidget_mac.mm qt_mac_set_fullscreen_mode uses kUIModeAllSuppressed which is unfortunate in our case
//
// http://developer.apple.com/mac/library/documentation/Carbon/Reference/Dock_Manager/Reference/reference.html#//apple_ref/c/func/SetSystemUIMode
//
//originalSetSystemUIMode = APEPatchCreate((const void *)SetSystemUIMode, (const void *)emptySetSystemUIMode);
//setDesktopMode(false);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to OpenBoard" ofType:@"workflow"];
@ -94,8 +85,6 @@ void UBPlatformUtils::init()
void UBPlatformUtils::setDesktopMode(bool desktop)
{
//qDebug() << "setDesktopMode called. desktop = " << desktop;
@try {
// temporarily disabled due to bug: when switching to desktop mode (and calling this),
// openboard switches right back to the board mode. clicking again on desktop mode works.

@ -60,7 +60,6 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent)
#endif
#ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
//setAttribute(Qt::WA_MacNonActivatingToolWindow); // no longer exists
setAttribute(Qt::WA_MacNoShadow);
#endif
}

@ -85,7 +85,6 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive)
#endif
#ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
//setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow);
#endif
}

@ -25,8 +25,6 @@
//#include <QGraphicsPolygonItem>
#include <QPolygonF>
#include <QtWidgets/QGraphicsPolygonItem>
@ -143,7 +141,6 @@ void UBGraphicsTriangle::setOrientation(UBGraphicsTriangleOrientation orientatio
{
mOrientation = orientation;
//calculatePoints(boundingRect());
calculatePoints(bounds_rect);
QPolygonF polygon;
@ -172,7 +169,6 @@ UBGraphicsScene* UBGraphicsTriangle::scene() const
void UBGraphicsTriangle::calculatePoints(const QRectF& r)
{
//qDebug() << "UBGraphicsTriangle calculatePoints()"<<"r ="<<r<<"mOrientation ="<<mOrientation;
switch(mOrientation)
{

@ -28,7 +28,6 @@
#ifndef UBGRAPHICSTRIANGLE_H_
#define UBGRAPHICSTRIANGLE_H_
//#include <QtGui>
#include <QtWidgets>
#include <QtSvg>

@ -49,7 +49,6 @@ void UBToolsManager::destroy()
UBToolsManager::UBToolsManager(QObject *parent)
: QObject(parent)
{
//mask.id = "uniboardTool://uniboard.mnemis.com/mask";
mask.id = "openboardtool://openboard/mask";
mask.icon = QPixmap(":/images/toolPalette/maskTool.png");
@ -58,7 +57,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(mask.id, ":/images/toolPalette/maskTool.png");
mDescriptors << mask;
//ruler.id = "uniboardTool://uniboard.mnemis.com/ruler";
ruler.id = "openboardtool://ruler";
ruler.icon = QPixmap(":/images/toolPalette/rulerTool.png");
@ -67,7 +65,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(ruler.id, ":/images/toolPalette/rulerTool.png");
mDescriptors << ruler;
//compass.id = "uniboardTool://uniboard.mnemis.com/compass";
compass.id = "openboardtool://compass";
compass.icon = QPixmap(":/images/toolPalette/compassTool.png");
@ -76,7 +73,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(compass.id, ":/images/toolPalette/compassTool.png");
mDescriptors << compass;
//protractor.id = "uniboardTool://uniboard.mnemis.com/protractor";
protractor.id = "openboardtool://protractor";
protractor.icon = QPixmap(":/images/toolPalette/protractorTool.png");
@ -85,7 +81,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(protractor.id,":/images/toolPalette/protractorTool.png");
mDescriptors << protractor;
//triangle.id = "uniboardTool://uniboard.mnemis.com/triangle";
triangle.id = "openboardtool://triangle";
triangle.icon = QPixmap(":/images/toolPalette/triangleTool.png");
@ -94,7 +89,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(triangle.id,":/images/toolPalette/triangleTool.png");
mDescriptors << triangle;
//magnifier.id = "uniboardTool://uniboard.mnemis.com/magnifier";
magnifier.id = "openboardtool://magnifier";
magnifier.icon = QPixmap(":/images/toolPalette/magnifierTool.png");
@ -103,7 +97,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(magnifier.id,":/images/toolPalette/magnifierTool.png");
mDescriptors << magnifier;
//cache.id = "uniboardTool://uniboard.mnemis.com/cache";
cache.id = "openboardtool://cache";
cache.icon = QPixmap(":/images/toolPalette/cacheTool.png");

Loading…
Cancel
Save