IndigoJo / qtm (http://qtm.blogistan.co.uk/)


A repository for the QTM blogging software
Clone URL : http://bitbucket.org/IndigoJo/qtm/ (size: 404.9 KB)
commit 116: 2e7a1b4d2dd8
parent 115: 07d622a463a1
branch: default
Fixed indents; updated versions, fixed override cursor problems EditingWindow.cc - Now always checks for an override cursor before restoring it, and moved the block to restore it to the end of blogger_getUsersBlogs (RPC handler); also, corrected several wrongly-indented blocks Changelog, CMakeLists.txt, README - Updated for 0.7 release
Matthew Smith / IndigoJo
3 months ago

Changed (Δ4.1 KB):

raw changeset »

CMakeLists.txt (1 lines added, 1 lines removed)

Changelog (3 lines added, 1 lines removed)

EditingWindow.cc (453 lines added, 448 lines removed)

README (1 lines added, 1 lines removed)

Up to file-list CMakeLists.txt:

@@ -1,6 +1,6 @@ project(QTM)
1
1
project(QTM)
2
2
3
set( QTM_VERSION 0.7-b1 )
3
set( QTM_VERSION 0.7 )
4
4
5
5
IF(APPLE)
6
6
    set( PROGNAME QTM )

Up to file-list Changelog:

@@ -1,6 +1,6 @@ Changelog:
1
1
Changelog:
2
2
3
0.7
3
0.7 (22nd Oct 2008):
4
4
5
5
New feature: Ability to specify "no categories" for a post, via a checkbox
6
6
in the categories page
@@ -10,6 +10,8 @@ Preview/Console" when they are activated
10
10
Preview/Console" when they are activated, and changed back when deactivated
11
11
Bug fix: sorted the "deprecated type conversion" warnings stemming from the
12
12
included XPM files
13
UI improvement: Number of secondary categories displayed next to "Others" in
14
the heading
13
15
Bug fix: displays ampersands in recent file menu properly
14
16
Bug fix: stopped adding XML-RPC fault codes to the main account tree
15
17

Up to file-list EditingWindow.cc:

@@ -915,10 +915,10 @@ void EditingWindow::setInitialAccount()
915
915
    cw.cbAccountSelector->clear();
916
916
917
917
    if( accountsList.count() == 1 &&
918
	accountsList.at( 0 ).firstChildElement( "details" ).isNull() ) {
918
        accountsList.at( 0 ).firstChildElement( "details" ).isNull() ) {
919
919
      // This is if there is just one legacy account
920
920
      QDomElement detailElem, titleElem, serverElem, portElem, locElem,
921
	loginElem, pwdElem;
921
                  loginElem, pwdElem;
922
922
      detailElem = accountsDom.createElement( "details" );
923
923
      titleElem = accountsDom.createElement( "title" );
924
924
      titleElem.appendChild( accountsDom.createTextNode( tr( "Default account" ) ) );
@@ -927,8 +927,8 @@ void EditingWindow::setInitialAccount()
927
927
      locElem = accountsDom.createElement( "location" );
928
928
      locElem.appendChild( accountsDom.createTextNode( location ) );
929
929
      if( !port.isEmpty() ) {
930
	portElem = accountsDom.createElement( "port" );
931
	portElem.appendChild( accountsDom.createTextNode( port ) );
930
        portElem = accountsDom.createElement( "port" );
931
        portElem.appendChild( accountsDom.createTextNode( port ) );
932
932
      }
933
933
      loginElem = accountsDom.createElement( "login" );
934
934
      loginElem.appendChild( accountsDom.createTextNode( login ) );
@@ -937,7 +937,7 @@ void EditingWindow::setInitialAccount()
937
937
      detailElem.appendChild( titleElem );
938
938
      detailElem.appendChild( serverElem );
939
939
      if( !portElem.isNull() )
940
	detailElem.appendChild( portElem );
940
        detailElem.appendChild( portElem );
941
941
      detailElem.appendChild( locElem );
942
942
      detailElem.appendChild( loginElem );
943
943
      detailElem.appendChild( pwdElem );
@@ -947,39 +947,39 @@ void EditingWindow::setInitialAccount()
947
947
948
948
    for( i = 0; i < accountsList.count(); i++ ) {
949
949
      thisTitleElem = accountsList.at( i ).toElement().firstChildElement( "details" )
950
	.firstChildElement( "title" );
950
        .firstChildElement( "title" );
951
951
      if( !thisTitleElem.isNull() )
952
	cw.cbAccountSelector->addItem( thisTitleElem.text(),
953
				       accountsList.at( i ).toElement().attribute( "id" ) );
954
      else
955
	cw.cbAccountSelector->addItem( tr( "Unnamed account" ),
956
				       accountsList.at( i ).toElement().attribute( "id" ).isEmpty() ?
957
				       QString( "noid_%1" ).arg( i ) :
958
				       accountsList.at( i ).toElement().attribute( "id" ) );
952
        cw.cbAccountSelector->addItem( thisTitleElem.text(),
953
                                       accountsList.at( i ).toElement().attribute( "id" ) );
954
      else
955
        cw.cbAccountSelector->addItem( tr( "Unnamed account" ),
956
                                       accountsList.at( i ).toElement().attribute( "id" ).isEmpty() ?
957
                                       QString( "noid_%1" ).arg( i ) :
958
                                       accountsList.at( i ).toElement().attribute( "id" ) );
959
959
    }
960
960
961
961
    qDebug() << "checking for last account ID";
962
962
    for( i = 0; i < accountsList.count(); i++ ) {
963
963
      if( accountsList.at( i ).toElement().attribute( "id" ) == lastAccountID ) {
964
	qDebug() << "found it";
965
	currentAccountElement = accountsList.at( i ).toElement();
966
	currentAccountId = currentAccountElement.attribute( "id" );
967
	cw.cbAccountSelector->setCurrentIndex( i );
964
        qDebug() << "found it";
965
        currentAccountElement = accountsList.at( i ).toElement();
966
        currentAccountId = currentAccountElement.attribute( "id" );
967
        cw.cbAccountSelector->setCurrentIndex( i );
968
968
        extractAccountDetails();
969
	populateBlogList();
970
	connect( cw.cbAccountSelector, SIGNAL( activated( int ) ),
971
		 this, SLOT( changeAccount( int ) ) );
972
	break;
969
        populateBlogList();
970
        connect( cw.cbAccountSelector, SIGNAL( activated( int ) ),
971
                 this, SLOT( changeAccount( int ) ) );
972
        break;
973
973
      }
974
974
      // If it reaches the end of the loop with no joy
975
975
      if( i == accountsList.count()-1 ) {
976
	qDebug() << "using first account";
977
	currentAccountElement = accountsDom.documentElement()
978
	  .firstChildElement( "account" );
976
        qDebug() << "using first account";
977
        currentAccountElement = accountsDom.documentElement()
978
          .firstChildElement( "account" );
979
979
        extractAccountDetails();
980
	populateBlogList();
981
	connect( cw.cbAccountSelector, SIGNAL( activated( int ) ),
982
		 this, SLOT( changeAccount( int ) ) );
980
        populateBlogList();
981
        connect( cw.cbAccountSelector, SIGNAL( activated( int ) ),
982
                 this, SLOT( changeAccount( int ) ) );
983
983
      }
984
984
    }
985
985
}
@@ -1648,35 +1648,41 @@ void EditingWindow::populateBlogList() /
1648
1648
    for( i = 0; i < a; i++ ) {
1649
1649
      ct = blogNodeList.at( i ).firstChildElement( "blogName" );
1650
1650
      cw.cbBlogSelector->addItem( blogNodeList.at( i ).firstChildElement( "blogName" ).text(),
1651
				  QVariant( blogNodeList.at( i ).firstChildElement( "blogid" ).text() ));
1651
                                  QVariant( blogNodeList.at( i ).firstChildElement( "blogid" ).text() ));
1652
1652
      currentBlog = i;
1653
1653
      currentBlogElement = currentAccountElement.firstChildElement( "blogs" )
1654
          .elementsByTagName( "blog" ).at( currentBlog ).toElement();
1654
        .elementsByTagName( "blog" ).at( currentBlog ).toElement();
1655
1655
      currentBlogid = currentBlogElement.firstChildElement( "blogid" ).text();
1656
1656
    }
1657
1657
1658
   currentBlog = cw.cbBlogSelector->currentIndex();
1659
1660
   catsElement = blogNodeList.at( currentBlog ).firstChildElement( "categories" );
1661
   if( !catsElement.isNull() ) {
1662
     catNodeList = catsElement.elementsByTagName( "category" );
1663
     b = catNodeList.count();
1664
     if( b ) {
1665
       for( j = 0; j < b; j++ ) {
1666
	 cw.cbMainCat->addItem( catNodeList.at( j ).firstChildElement( "categoryName" ).text(),
1667
				QVariant( catNodeList.at( j ).firstChildElement( "categoryId" ).text() ) );
1668
	 cw.lwOtherCats->addItem( catNodeList.at( j ).firstChildElement( "categoryName" ).text() );
1669
       }
1670
     }
1671
     else {
1672
       cw.chNoCats->setEnabled( false );
1673
       cw.cbMainCat->setEnabled( false );
1674
       cw.lwOtherCats->setEnabled( false );
1675
     }
1676
1677
   }
1678
   connect( cw.cbBlogSelector, SIGNAL( activated( int ) ),
1679
	    this, SLOT( changeBlog( int ) ) );
1658
    currentBlog = cw.cbBlogSelector->currentIndex();
1659
1660
    catsElement = blogNodeList.at( currentBlog ).firstChildElement( "categories" );
1661
    if( !catsElement.isNull() ) {
1662
      catNodeList = catsElement.elementsByTagName( "category" );
1663
      b = catNodeList.count();
1664
      if( b ) {
1665
        for( j = 0; j < b; j++ ) {
1666
          cw.cbMainCat->addItem( catNodeList.at( j ).firstChildElement( "categoryName" ).text(),
1667
                                 QVariant( catNodeList.at( j ).firstChildElement( "categoryId" ).text() ) );
1668
          cw.lwOtherCats->addItem( catNodeList.at( j ).firstChildElement( "categoryName" ).text() );
1669
        }
1670
      }
1671
      else {
1672
        cw.chNoCats->setEnabled( false );
1673
        cw.cbMainCat->setEnabled( false );
1674
        cw.lwOtherCats->setEnabled( false );
1675
      }
1676
1677
    }
1678
    connect( cw.cbBlogSelector, SIGNAL( activated( int ) ),
1679
             this, SLOT( changeBlog( int ) ) );
1680
  }
1681
  else {
1682
    cw.cbBlogSelector->setEnabled( false );
1683
    cw.chNoCats->setEnabled( false );
1684
    cw.cbMainCat->setEnabled( false );
1685
    cw.lwOtherCats->setEnabled( false );
1680
1686
  }
1681
1687
}
1682
1688
@@ -1879,16 +1885,16 @@ void EditingWindow::changeBlog( int b )
1879
1885
      for( int i = 0; i < c; i++ ) {
1880
1886
        currentCategoryText = catsList.at( i ).firstChildElement( "categoryName" ).text();
1881
1887
        cw.cbMainCat->addItem( currentCategoryText,
1882
			       QVariant( catsList.at( i ).firstChildElement( "categoryId" ).text() ) );
1888
                               QVariant( catsList.at( i ).firstChildElement( "categoryId" ).text() ) );
1883
1889
        cw.lwOtherCats->addItem( currentCategoryText );
1884
	cw.chNoCats->setEnabled( true );
1885
	cw.cbMainCat->setEnabled( true );
1886
	cw.lwOtherCats->setEnabled( true );
1887
	statusBar()->clearMessage(); // as otherwise, "there are no categories" would still show
1890
        cw.chNoCats->setEnabled( true );
1891
        cw.cbMainCat->setEnabled( true );
1892
        cw.lwOtherCats->setEnabled( true );
1893
        statusBar()->clearMessage(); // as otherwise, "there are no categories" would still show
1888
1894
      }
1889
1895
      emit categoryRefreshFinished();
1890
1896
      if( QApplication::overrideCursor() != 0 )
1891
	QApplication::restoreOverrideCursor();
1897
        QApplication::restoreOverrideCursor();
1892
1898
    }
1893
1899
    else
1894
1900
      callRefreshCategories();
@@ -1935,8 +1941,6 @@ void EditingWindow::blogger_getUsersBlog
1935
1941
    cw.cbMainCat->clear();
1936
1942
    cw.lwOtherCats->setEnabled( false );
1937
1943
    cw.lwOtherCats->clear();
1938
    if( QApplication::overrideCursor() )
1939
      QApplication::restoreOverrideCursor();
1940
1944
  }
1941
1945
  else {
1942
1946
    if( !i ) {
@@ -1954,27 +1958,29 @@ void EditingWindow::blogger_getUsersBlog
1954
1958
      currentAccountElement.appendChild( accountsDom.importNode( importedBlogList.firstChildElement( "blogs" ), true ) );
1955
1959
1956
1960
      for( int a = 0; a < i; a++ ) {
1957
	cw.cbBlogSelector->addItem( blogNodeList.at( a ).firstChildElement( "blogName" ).text(),
1958
				    QVariant( blogNodeList.at( a ).firstChildElement( "blogid" ).text() ) );
1959
	currentBlog = cw.cbBlogSelector->currentIndex();
1961
        cw.cbBlogSelector->addItem( blogNodeList.at( a ).firstChildElement( "blogName" ).text(),
1962
                                    QVariant( blogNodeList.at( a ).firstChildElement( "blogid" ).text() ) );
1963
        currentBlog = cw.cbBlogSelector->currentIndex();
1960
1964
      }
1961
1965
      cw.cbBlogSelector->setEnabled( true );
1962
1966
      connect( cw.cbBlogSelector, SIGNAL( activated( int ) ),
1963
	       this, SLOT( changeBlog( int ) ) );
1967
               this, SLOT( changeBlog( int ) ) );
1964
1968
      addToConsole( accountsDom.toString( 2 ) );
1965
1969
1966
1970
      if( !initialChangeBlog )
1967
	connect( cw.cbBlogSelector, SIGNAL( activated( int ) ),
1968
		 this, SLOT( changeBlog( int ) ) );
1971
        connect( cw.cbBlogSelector, SIGNAL( activated( int ) ),
1972
                 this, SLOT( changeBlog( int ) ) );
1969
1973
1970
1974
      if( loadedEntryBlog != 999 )
1971
	connect( this, SIGNAL( httpBusinessFinished() ),
1972
		 this, SLOT( doInitialChangeBlog() ) );
1975
        connect( this, SIGNAL( httpBusinessFinished() ),
1976
                 this, SLOT( doInitialChangeBlog() ) );
1973
1977
    }
1974
1978
  }
1975
1979
#ifndef NO_DEBUG_OUTPUT
1976
1980
  qDebug() << "Finished handling the output";
1977
1981
#endif
1982
  if( QApplication::overrideCursor() )
1983
    QApplication::restoreOverrideCursor();
1978
1984
}
1979
1985
1980
1986
void EditingWindow::metaWeblog_newPost( QByteArray response )
@@ -1988,7 +1994,8 @@ void EditingWindow::metaWeblog_newPost(
1988
1994
  addToConsole( QString( response ) );
1989
1995
  if( response.contains( "<fault>" ) ) {
1990
1996
    statusBar()->showMessage( tr( "The submission returned a fault - see console." ), 2000 );
1991
    QApplication::restoreOverrideCursor();
1997
    if( QApplication::overrideCursor() )
1998
      QApplication::restoreOverrideCursor();
1992
1999
  }
1993
2000
  else {
1994
2001
    QString parsedData( response );
@@ -2000,9 +2007,9 @@ void EditingWindow::metaWeblog_newPost(
2000
2007
2001
2008
    if( !entryEverSaved ) {
2002
2009
      if( postAsSave && cleanSave ) {
2003
	setWindowModified( false );
2004
	dirtyIndicator->hide();
2005
	setDirtySignals( true );
2010
        setWindowModified( false );
2011
        dirtyIndicator->hide();
2012
        setDirtySignals( true );
2006
2013
      }
2007
2014
    }
2008
2015
  }
@@ -2023,9 +2030,9 @@ void EditingWindow::metaWeblog_editPost(
2023
2030
	     this, SLOT( setPostCategories() ) );
2024
2031
    if( !entryEverSaved ) {
2025
2032
      if( postAsSave && cleanSave ) {
2026
	setWindowModified( false );
2027
	dirtyIndicator->hide();
2028
	setDirtySignals( true );
2033
        setWindowModified( false );
2034
        dirtyIndicator->hide();
2035
        setDirtySignals( true );
2029
2036
      }
2030